module Shoulda::Matchers::Doublespeak::DoubleImplementationRegistry

@private

Public Class Methods

find(type) click to toggle source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 7
def find(type)
  find_class!(type).create
end
register(klass, type) click to toggle source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 11
def register(klass, type)
  registry[type] = klass
end

Private Class Methods

find_class!(type) click to toggle source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 17
def find_class!(type)
  registry.fetch(type) do
    raise ArgumentError, 'No double implementation class found for'\
      " '#{type}'"
  end
end
registry() click to toggle source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 24
def registry
  @_registry ||= {}
end