Class: Rubasteme::AST::LeafNode
- Defined in:
- lib/rubasteme/ast/leaf_node.rb
Direct Known Subclasses
BooleanNode, CharacterNode, DotNode, EmptyListNode, IdentifierNode, NumberNode, StringNode
Instance Attribute Summary collapse
-
#literal ⇒ Object
readonly
Returns the value of attribute literal.
Instance Method Summary collapse
-
#initialize(literal) ⇒ LeafNode
constructor
A new instance of LeafNode.
- #to_a ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(literal) ⇒ LeafNode
Returns a new instance of LeafNode.
7 8 9 10 |
# File 'lib/rubasteme/ast/leaf_node.rb', line 7 def initialize(literal) super @literal = literal end |
Instance Attribute Details
#literal ⇒ Object (readonly)
Returns the value of attribute literal.
12 13 14 |
# File 'lib/rubasteme/ast/leaf_node.rb', line 12 def literal @literal end |
Instance Method Details
#to_a ⇒ Object
14 15 16 |
# File 'lib/rubasteme/ast/leaf_node.rb', line 14 def to_a [type, @literal] end |