Class: KPeg::Action
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
Instance Method Summary collapse
- #==(obj) ⇒ Object
-
#initialize(action) ⇒ Action
constructor
A new instance of Action.
- #inspect ⇒ Object
- #match(x) ⇒ Object
Methods inherited from Operator
#detect_tags, #inspect_type, #prune_values, #set_action, #|
Constructor Details
#initialize(action) ⇒ Action
Returns a new instance of Action.
549 550 551 552 |
# File 'lib/kpeg/grammar.rb', line 549 def initialize(action) super() @action = action end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
554 555 556 |
# File 'lib/kpeg/grammar.rb', line 554 def action @action end |
Instance Method Details
#==(obj) ⇒ Object
560 561 562 563 564 565 566 567 |
# File 'lib/kpeg/grammar.rb', line 560 def ==(obj) case obj when Action @action == obj.action else super end end |
#inspect ⇒ Object
569 570 571 |
# File 'lib/kpeg/grammar.rb', line 569 def inspect inspect_type "action", "=> #{action.inspect}" end |
#match(x) ⇒ Object
556 557 558 |
# File 'lib/kpeg/grammar.rb', line 556 def match(x) return MatchString.new(self, "") end |