module Shoulda::Matchers::Doublespeak::DoubleImplementationRegistry
@private
Public Class Methods
Source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 7 def find(type) find_class!(type).create end
Source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 11 def register(klass, type) registry[type] = klass end
Private Class Methods
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
Source
# File lib/shoulda/matchers/doublespeak/double_implementation_registry.rb, line 24 def registry @_registry ||= {} end