Class: Rrrex::RangeMatch
- Includes:
- SingleAtomMatch
- Defined in:
- lib/rrrex/range_match.rb
Instance Attribute Summary
Attributes included from SingleAtomMatch
Instance Method Summary collapse
-
#initialize(range) ⇒ RangeMatch
constructor
A new instance of RangeMatch.
- #to_regexp_string ⇒ Object
Methods included from SingleAtomMatch
Methods inherited from Match
#+, convert, #group_names, #match, #not, #or, #wrap
Constructor Details
#initialize(range) ⇒ RangeMatch
Returns a new instance of RangeMatch.
6 7 8 |
# File 'lib/rrrex/range_match.rb', line 6 def initialize( range ) @range = range end |
Instance Method Details
#to_regexp_string ⇒ Object
10 11 12 |
# File 'lib/rrrex/range_match.rb', line 10 def to_regexp_string wrap "[#{@range.first}-#{@range.last}]" end |