Class: Kleene::OnlineMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/kleene/naive_online_regex.rb

Overview

A MatchData pair

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#matchObject (readonly)

MatchData



52
53
54
# File 'lib/kleene/naive_online_regex.rb', line 52

def match
  @match
end

#regexObject (readonly)

Regexp



51
52
53
# File 'lib/kleene/naive_online_regex.rb', line 51

def regex
  @regex
end

Instance Method Details

#to_aObject



56
57
58
# File 'lib/kleene/naive_online_regex.rb', line 56

def to_a
  @match.to_a
end

#to_hObject



59
60
61
# File 'lib/kleene/naive_online_regex.rb', line 59

def to_h
  {@regex => to_a}
end