Class: KPeg::Dot

Inherits:
Operator show all
Defined in:
lib/kpeg/grammar.rb

Instance Attribute Summary

Attributes inherited from Operator

#action

Instance Method Summary collapse

Methods inherited from Operator

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

Constructor Details

This class inherits a constructor from KPeg::Operator

Instance Method Details

#==(obj) ⇒ Object



63
64
65
# File 'lib/kpeg/grammar.rb', line 63

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

#inspectObject



67
68
69
# File 'lib/kpeg/grammar.rb', line 67

def inspect
  "#<dot>"
end

#match(x) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/kpeg/grammar.rb', line 55

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