Class: Arugula::MetacharacterPart
Constant Summary collapse
- MATCHERS =
{ A: ->(_str, index) { index == 0 }, d: ->(str, index) { ('0'..'9').member?(str[index]) }, s: ->(str, index) { [' ', "\t"].include?(str[index]) }, S: ->(str, index) { ![' ', "\t"].include?(str[index]) }, }.freeze
- OFFSETS =
begin offsets = { A: 0, } offsets.default = 1 offsets.freeze end
Instance Method Summary collapse
-
#initialize(metachar) ⇒ MetacharacterPart
constructor
A new instance of MetacharacterPart.
- #match(str, index) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Part
Constructor Details
#initialize(metachar) ⇒ MetacharacterPart
Returns a new instance of MetacharacterPart.
113 114 115 |
# File 'lib/arugula/parts.rb', line 113 def initialize() @metachar = .to_sym end |