Class: Kleene::OnlineMatch
- Inherits:
-
Object
- Object
- Kleene::OnlineMatch
- Defined in:
- lib/kleene/naive_online_regex.rb
Overview
A MatchData pair
Instance Attribute Summary collapse
-
#match ⇒ Object
readonly
MatchData.
-
#regex ⇒ Object
readonly
Regexp.
Instance Method Summary collapse
-
#initialize(regex, match) ⇒ OnlineMatch
constructor
A new instance of OnlineMatch.
- #to_a ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(regex, match) ⇒ OnlineMatch
Returns a new instance of OnlineMatch.
53 54 55 |
# File 'lib/kleene/naive_online_regex.rb', line 53 def initialize(regex, match) @regex, @match = regex, match end |
Instance Attribute Details
#match ⇒ Object (readonly)
MatchData
52 53 54 |
# File 'lib/kleene/naive_online_regex.rb', line 52 def match @match end |
#regex ⇒ Object (readonly)
Regexp
51 52 53 |
# File 'lib/kleene/naive_online_regex.rb', line 51 def regex @regex end |
Instance Method Details
#to_a ⇒ Object
56 57 58 |
# File 'lib/kleene/naive_online_regex.rb', line 56 def to_a @match.to_a end |
#to_h ⇒ Object
59 60 61 |
# File 'lib/kleene/naive_online_regex.rb', line 59 def to_h {@regex => to_a} end |