Class: Fixturex::TreeEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/fixturex/tree_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#childrenObject

Returns the value of attribute children



2
3
4
# File 'lib/fixturex/tree_entry.rb', line 2

def children
  @children
end

#valueObject

Returns the value of attribute value



2
3
4
# File 'lib/fixturex/tree_entry.rb', line 2

def value
  @value
end

Instance Method Details

#to_hObject



3
4
5
6
7
8
# File 'lib/fixturex/tree_entry.rb', line 3

def to_h
  {
    value: value.to_h,
    children: children.map(&:to_h)
  }
end