Class: Contrek::Matchers::Matcher
- Inherits:
-
Object
- Object
- Contrek::Matchers::Matcher
- Defined in:
- lib/contrek/matchers/matcher.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#counters ⇒ Object
readonly
Returns the value of attribute counters.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(value) ⇒ Matcher
constructor
A new instance of Matcher.
- #match?(value) ⇒ Boolean
- #unmatch?(value) ⇒ Boolean
Constructor Details
#initialize(value) ⇒ Matcher
Returns a new instance of Matcher.
5 6 7 8 9 |
# File 'lib/contrek/matchers/matcher.rb', line 5 def initialize(value) @value_is = value @values = [] @counters = {} end |
Instance Attribute Details
#counters ⇒ Object (readonly)
Returns the value of attribute counters.
4 5 6 |
# File 'lib/contrek/matchers/matcher.rb', line 4 def counters @counters end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
4 5 6 |
# File 'lib/contrek/matchers/matcher.rb', line 4 def values @values end |
Instance Method Details
#match?(value) ⇒ Boolean
11 12 13 |
# File 'lib/contrek/matchers/matcher.rb', line 11 def match?(value) @value_is == value end |
#unmatch?(value) ⇒ Boolean
15 16 17 |
# File 'lib/contrek/matchers/matcher.rb', line 15 def unmatch?(value) !match?(value) end |