Class: Arugula::NotPart

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



202
203
204
205
# File 'lib/arugula/parts.rb', line 202

def match(str, index, match_data)
  matches, end_index = wrapped.match(str, index, match_data)
  [!matches, matches ? index : end_index + 1]
end

#to_sObject



198
199
200
# File 'lib/arugula/parts.rb', line 198

def to_s
  @wrapped.to_s.dup.insert(1, '^')
end