Class: Arugula::PlusPart

Inherits:
Part
  • Object
show all
Includes:
Wrapping
Defined in:
lib/arugula/parts.rb

Instance Attribute Summary

Attributes included from Wrapping

#wrapped

Instance Method Summary collapse

Methods included from Wrapping

#initialize

Methods inherited from Part

all, inherited, type

Instance Method Details

#match(str, index, match_data) ⇒ Object



204
205
206
207
208
209
210
211
# File 'lib/arugula/parts.rb', line 204

def match(str, index, match_data)
  has_matched = false
  loop do
    matches, index = wrapped.match(str, index, match_data)
    has_matched = true if matches
    return has_matched, index unless matches
  end
end

#to_sObject



200
201
202
# File 'lib/arugula/parts.rb', line 200

def to_s
  "#{wrapped}+"
end