Class: KPeg::Action

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

Instance Attribute Summary (collapse)

Attributes inherited from Rule

#name

Instance Method Summary (collapse)

Methods inherited from Rule

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

Constructor Details

- (Action) initialize(action)

Returns a new instance of Action



686
687
688
689
# File 'lib/vendor/kpeg/lib/kpeg.rb', line 686

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

Instance Attribute Details

- (Object) action (readonly)

Returns the value of attribute action



691
692
693
# File 'lib/vendor/kpeg/lib/kpeg.rb', line 691

def action
  @action
end

Instance Method Details

- (Object) ==(obj)



697
698
699
700
701
702
703
704
# File 'lib/vendor/kpeg/lib/kpeg.rb', line 697

def ==(obj)
  case obj
  when Action
    @action == obj.action
  else
    super
  end
end

- (Object) inspect



706
707
708
# File 'lib/vendor/kpeg/lib/kpeg.rb', line 706

def inspect
  inspect_type "action", "=> #{action.inspect}"
end

- (Object) match(x)



693
694
695
# File 'lib/vendor/kpeg/lib/kpeg.rb', line 693

def match(x)
  return Match.new(self, "")
end