Class: Mustermann::Set::Match
- Defined in:
- lib/mustermann/set/match.rb
Overview
Subclass of Match that also includes the value associated with the pattern that produced the match.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
The value associated with the pattern that produced the match, if any.
Attributes inherited from Match
#captures, #named_captures, #params, #pattern, #post_match, #pre_match, #regexp, #string
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
-
#initialize(value: nil) ⇒ Match
constructor
A new instance of Match.
Methods inherited from Match
#[], #deconstruct_keys, #hash, #to_s, #values_at
Constructor Details
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value associated with the pattern that produced the match, if any.
10 11 12 |
# File 'lib/mustermann/set/match.rb', line 10 def value @value end |
Instance Method Details
#eql?(other) ⇒ Boolean
20 |
# File 'lib/mustermann/set/match.rb', line 20 def eql?(other) = super && value == other.value |