Class: KPeg::Dot

Inherits:
Rule
  • Object
show all
Defined in:
lib/vendor/kpeg/lib/kpeg.rb

Instance Attribute Summary

Attributes inherited from Rule

#action, #name

Instance Method Summary (collapse)

Methods inherited from Rule

#detect_tags, #initialize, #inspect_type, #prune_values, #set_action, #|

Constructor Details

This class inherits a constructor from KPeg::Rule

Instance Method Details

- (Object) ==(obj)



305
306
307
# File 'lib/vendor/kpeg/lib/kpeg.rb', line 305

def ==(obj)
  Dot === obj ? true : false
end

- (Object) inspect



309
310
311
312
313
314
315
# File 'lib/vendor/kpeg/lib/kpeg.rb', line 309

def inspect
  if @name
    "#<dot:#{@name}>"
  else
    "#<dot>"
  end
end

- (Object) match(x)



297
298
299
300
301
302
303
# File 'lib/vendor/kpeg/lib/kpeg.rb', line 297

def match(x)
  if str = x.get_byte
    Match.new(self, str)
  else
    x.fail(self)
  end
end