Class: IndexedNode
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- IndexedNode
- Includes:
- Concrete
- Defined in:
- lib/indexed_node.rb
Instance Attribute Summary
Attributes inherited from AbstractNode
Instance Method Summary collapse
- #<<(sub_node) ⇒ Object
-
#initialize(data = nil, *sub_nodes) ⇒ IndexedNode
constructor
A new instance of IndexedNode.
Methods included from Concrete
Methods inherited from AbstractNode
#[], #[]=, #delete, #each_index, #each_node, #each_pair, #leaf?, #merge!, #nb_sub_nodes, #pre_depth_first
Methods included from Abstract
Constructor Details
#initialize(data = nil, *sub_nodes) ⇒ IndexedNode
Returns a new instance of IndexedNode.
12 13 14 15 |
# File 'lib/indexed_node.rb', line 12 def initialize(data=nil, *sub_nodes) @sub_nodes = sub_nodes super end |
Instance Method Details
#<<(sub_node) ⇒ Object
17 18 19 20 |
# File 'lib/indexed_node.rb', line 17 def <<(sub_node) check_sub_node_type(sub_node) @sub_nodes << sub_node end |