Class: KPeg::Bounds

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

Instance Attribute Summary collapse

Attributes inherited from Operator

#action

Instance Method Summary collapse

Methods inherited from Operator

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

Constructor Details

#initialize(op) ⇒ Bounds

Returns a new instance of Bounds.



614
615
616
617
# File 'lib/kpeg/grammar.rb', line 614

def initialize(op)
  super()
  @op = op
end

Instance Attribute Details

#opObject (readonly)

Returns the value of attribute op.



619
620
621
# File 'lib/kpeg/grammar.rb', line 619

def op
  @op
end

Instance Method Details

#==(obj) ⇒ Object



621
622
623
624
625
626
627
628
# File 'lib/kpeg/grammar.rb', line 621

def ==(obj)
  case obj
  when Bounds
    @op == obj.op
  else
    super
  end
end

#inspectObject



630
631
632
# File 'lib/kpeg/grammar.rb', line 630

def inspect
  inspect_type "bounds", @op.inspect
end