class Arugula::MetacharacterPart

Constants

MATCHERS
OFFSETS

Public Class Methods

new(metachar) click to toggle source
# File lib/arugula/parts.rb, line 132
def initialize(metachar)
  @metachar = metachar.to_sym
end

Public Instance Methods

match(str, index, _match_data) click to toggle source
# File lib/arugula/parts.rb, line 136
def match(str, index, _match_data)
  matches = MATCHERS[@metachar][str, index]
  [matches, index + (matches ? OFFSETS[@metachar][str, index] : 0)]
end
to_s() click to toggle source
# File lib/arugula/parts.rb, line 141
def to_s
  "\\#{@metachar}"
end