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) ⇒ Object



186
187
188
189
190
191
192
193
# File 'lib/arugula/parts.rb', line 186

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

#to_sObject



182
183
184
# File 'lib/arugula/parts.rb', line 182

def to_s
  "#{wrapped}+"
end