Class: TreeBranch::SimpleNode
- Defined in:
- lib/tree_branch/simple_node.rb
Overview
A basic subclass of Node that makes the data element a deterministic and comparable OpenStruct object.
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(data: {}, children: []) ⇒ SimpleNode
constructor
A new instance of SimpleNode.
Methods inherited from Node
Constructor Details
#initialize(data: {}, children: []) ⇒ SimpleNode
Returns a new instance of SimpleNode.
16 17 18 19 |
# File 'lib/tree_branch/simple_node.rb', line 16 def initialize(data: {}, children: []) @data = OpenStruct.new(data) @children = self.class.array(children) end |