module Shoulda::Matchers::Doublespeak::DoubleImplementationRegistry

@private

Constants

REGISTRY

Public Class Methods

find(type) click to toggle source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 9
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 13
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 19
def find_class!(type)
  REGISTRY.fetch(type) do
    raise ArgumentError, "No double implementation class found for '#{type}'"
  end
end