Class: Mocktail::MatcherRegistry
- Inherits:
-
Object
- Object
- Mocktail::MatcherRegistry
- 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
- #add(matcher_type) ⇒ Object
- #get(name) ⇒ Object
-
#initialize ⇒ MatcherRegistry
constructor
A new instance of MatcherRegistry.
Constructor Details
#initialize ⇒ MatcherRegistry
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
.instance ⇒ Object
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 |