Class: Keisan::AST::Parent
Direct Known Subclasses
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Instance Method Summary collapse
-
#initialize(children = []) ⇒ Parent
constructor
A new instance of Parent.
Methods inherited from Node
Constructor Details
#initialize(children = []) ⇒ Parent
Returns a new instance of Parent.
6 7 8 9 10 11 12 |
# File 'lib/keisan/ast/parent.rb', line 6 def initialize(children = []) children = Array.wrap(children) unless children.is_a?(Array) && children.all? {|children| children.is_a?(Node)} raise Keisan::Exceptions::InternalError.new end @children = children end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
4 5 6 |
# File 'lib/keisan/ast/parent.rb', line 4 def children @children end |