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.



604
605
606
607
# File 'lib/kpeg/grammar.rb', line 604

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

Instance Attribute Details

#opObject (readonly)

Returns the value of attribute op.



609
610
611
# File 'lib/kpeg/grammar.rb', line 609

def op
  @op
end

Instance Method Details

#==(obj) ⇒ Object



611
612
613
614
615
616
617
618
# File 'lib/kpeg/grammar.rb', line 611

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

#inspectObject



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

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