module Shoulda::Matchers::Doublespeak::DoubleImplementationRegistry
Constants
- REGISTRY
Public Instance Methods
find(type)
click to toggle source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 8 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 12 def register(klass, type) REGISTRY[type] = klass end
Private Instance Methods
find_class!(type)
click to toggle source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 18 def find_class!(type) REGISTRY.fetch(type) do raise ArgumentError, "No double implementation class found for '#{type}'" end end