Class: Rrrex::RangeMatch

Inherits:
Match
  • Object
show all
Includes:
SingleAtomMatch
Defined in:
lib/rrrex/range_match.rb

Instance Attribute Summary

Attributes included from SingleAtomMatch

#atom

Instance Method Summary collapse

Methods included from SingleAtomMatch

#group_names

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_stringObject



10
11
12
# File 'lib/rrrex/range_match.rb', line 10

def to_regexp_string
  wrap "[#{@range.first}-#{@range.last}]"
end