Class: Mocktail::MatcherRegistry

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mocktail/value/matcher_registry.rb,
lib/mocktail/sorbet/mocktail/value/matcher_registry.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMatcherRegistry

Returns a new instance of MatcherRegistry.



9
10
11
# File 'lib/mocktail/value/matcher_registry.rb', line 9

def initialize
  @matchers = {}
end

Class Method Details

.instanceObject



5
6
7
# File 'lib/mocktail/value/matcher_registry.rb', line 5

def self.instance
  @matcher_registry ||= new
end

Instance Method Details

#add(matcher_type) ⇒ Object



13
14
15
# File 'lib/mocktail/value/matcher_registry.rb', line 13

def add(matcher_type)
  @matchers[matcher_type.matcher_name] = matcher_type
end

#get(name) ⇒ Object



17
18
19
# File 'lib/mocktail/value/matcher_registry.rb', line 17

def get(name)
  @matchers[name]
end