Class: TagChunk
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(tag, label = nil) ⇒ TagChunk
constructor
A new instance of TagChunk.
- #to_s ⇒ Object
Constructor Details
#initialize(tag, label = nil) ⇒ TagChunk
Returns a new instance of TagChunk.
7 8 9 10 |
# File 'lib/antlr4/tree/Chunk.rb', line 7 def initialize(tag, label=nil) self.tag = tag self.label = label end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
6 7 8 |
# File 'lib/antlr4/tree/Chunk.rb', line 6 def label @label end |
#tag ⇒ Object
Returns the value of attribute tag.
6 7 8 |
# File 'lib/antlr4/tree/Chunk.rb', line 6 def tag @tag end |
Instance Method Details
#to_s ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/antlr4/tree/Chunk.rb', line 12 def to_s if self.label.nil? self.tag else "#{self.label}:#{self.tag}" end end |