class TreeBranch::SimpleNode

A basic subclass of Node that makes the data element a deterministic and comparable OpenStruct object.

Public Class Methods

new(data: {}, children: []) click to toggle source
# File lib/tree_branch/simple_node.rb, line 16
def initialize(data: {}, children: [])
  @data     = OpenStruct.new(data)
  @children = self.class.array(children)
end