Class: ParserCombinator::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/parser_combinator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item, tag) ⇒ Item

Returns a new instance of Item.



30
31
32
# File 'lib/parser_combinator.rb', line 30

def initialize(item, tag)
  @item, @tag = item, tag
end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



28
29
30
# File 'lib/parser_combinator.rb', line 28

def item
  @item
end

#tagObject (readonly)

Returns the value of attribute tag.



28
29
30
# File 'lib/parser_combinator.rb', line 28

def tag
  @tag
end

Instance Method Details

#inspectObject



38
39
40
# File 'lib/parser_combinator.rb', line 38

def inspect
  "Item {item = #{item}, tag = #{tag}}"
end

#to_sObject



34
35
36
# File 'lib/parser_combinator.rb', line 34

def to_s
  item.to_s
end