class Arugula::CapturePart

Attributes

name[R]

Public Class Methods

new(name) click to toggle source
Calls superclass method Arugula::MatchAll::new
# File lib/arugula/parts.rb, line 150
def initialize(name)
  @name = name
  super()
end

Public Instance Methods

match(str, index, match_data) click to toggle source
Calls superclass method Arugula::MatchAll#match
# File lib/arugula/parts.rb, line 159
def match(str, index, match_data)
  matches, end_index = super
  match_data.add_capture(@name, index, end_index) if matches
  [matches, end_index]
end
to_s() click to toggle source
# File lib/arugula/parts.rb, line 155
def to_s
  "(#{parts.join})"
end