Class: Electr::ConstantAST
Overview
A constant node in the AST, ie the number pi.
Instance Attribute Summary
Attributes inherited from AST
Instance Method Summary collapse
-
#initialize(value) ⇒ ConstantAST
constructor
A new instance of ConstantAST.
Methods inherited from AST
#add_child, #display, #leaf?, #size, #to_pn
Constructor Details
#initialize(value) ⇒ ConstantAST
Returns a new instance of ConstantAST.
6 7 8 9 |
# File 'lib/electr/ast/constant_ast.rb', line 6 def initialize(value) super("constant") @value = value end |