Class: IndexedNode

Inherits:
AbstractNode show all
Includes:
Concrete
Defined in:
lib/indexed_node.rb

Instance Attribute Summary

Attributes inherited from AbstractNode

#data, #sub_nodes

Instance Method Summary collapse

Methods included from Concrete

included

Methods inherited from AbstractNode

#[], #[]=, #delete, #each_index, #each_node, #each_pair, #leaf?, #merge!, #nb_sub_nodes, #pre_depth_first

Methods included from Abstract

included

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