class Shoulda::Matchers::Integrations::Registry

@private

Public Instance Methods

find!(name) click to toggle source
# File lib/shoulda/matchers/integrations/registry.rb, line 10
def find!(name)
  find_class!(name).new
end
register(klass, name) click to toggle source
# File lib/shoulda/matchers/integrations/registry.rb, line 6
def register(klass, name)
  registry[name] = klass
end

Private Instance Methods

find_class!(name) click to toggle 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
registry() click to toggle source
# File lib/shoulda/matchers/integrations/registry.rb, line 16
def registry
  @_registry ||= {}
end