Class: Beckett::Node::Root

Inherits:
Base
  • Object
show all
Defined in:
lib/beckett/node/root.rb

Instance Attribute Summary

Attributes inherited from Base

#children, #node, #position

Instance Method Summary collapse

Methods inherited from Base

#<<, #initialize, #inspect, #to_s

Constructor Details

This class inherits a constructor from Beckett::Node::Base

Instance Method Details

#to_hObject



3
4
5
6
7
8
9
# File 'lib/beckett/node/root.rb', line 3

def to_h
  {
    root: {}.tap do |root|
      root[:children] = children.map(&:to_h)
    end
  }
end