class Shoulda::Matchers::Integrations::Registry
@private
Public Instance Methods
Source
# File lib/shoulda/matchers/integrations/registry.rb, line 10 def find!(name) find_class!(name).new end
Source
# File lib/shoulda/matchers/integrations/registry.rb, line 6 def register(klass, name) registry[name] = klass end
Private Instance Methods
Source
# File lib/shoulda/matchers/integrations/registry.rb, line 20 def find_class!(name) registry.fetch(name) do raise ArgumentError, "'#{name}' is not registered" end end
Source
# File lib/shoulda/matchers/integrations/registry.rb, line 16 def registry @_registry ||= {} end