Class: Rrrex::GroupMatch
- Includes:
- SingleAtomMatch
- Defined in:
- lib/rrrex/group_match.rb
Instance Attribute Summary
Attributes included from SingleAtomMatch
Instance Method Summary collapse
- #group_names ⇒ Object
-
#initialize(atom, name) ⇒ GroupMatch
constructor
A new instance of GroupMatch.
- #to_regexp_string ⇒ Object
Methods inherited from Match
#+, convert, #match, #not, #or, #wrap
Constructor Details
#initialize(atom, name) ⇒ GroupMatch
Returns a new instance of GroupMatch.
6 7 8 9 |
# File 'lib/rrrex/group_match.rb', line 6 def initialize atom, name @name = name super atom end |
Instance Method Details
#group_names ⇒ Object
15 16 17 18 |
# File 'lib/rrrex/group_match.rb', line 15 def group_names names = @atom.group_names || [] names.unshift @name end |
#to_regexp_string ⇒ Object
11 12 13 |
# File 'lib/rrrex/group_match.rb', line 11 def to_regexp_string "(#{atom.to_regexp_string})" end |