Class: CompSci::FlexNode
Overview
accumulate children; no child gaps
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#add_child(node) ⇒ Object
These methods look like convenience methods, but they provide the FlexNode interface also used by ChildFlexNode.
- #add_parent(node) ⇒ Object
- #new_child(value) ⇒ Object
Methods inherited from Node
#initialize, #inspect, #set_child, #to_s
Constructor Details
This class inherits a constructor from CompSci::Node
Instance Method Details
#add_child(node) ⇒ Object
These methods look like convenience methods, but they provide the FlexNode interface also used by ChildFlexNode
55 56 57 |
# File 'lib/compsci/node.rb', line 55 def add_child(node) @children << node end |
#add_parent(node) ⇒ Object
63 64 65 |
# File 'lib/compsci/node.rb', line 63 def add_parent(node) node.add_child(self) end |
#new_child(value) ⇒ Object
59 60 61 |
# File 'lib/compsci/node.rb', line 59 def new_child(value) self.add_child self.class.new(value) end |