Class: TreeHaver::OrderedTreePrimitives
- Inherits:
-
Struct
- Object
- Struct
- TreeHaver::OrderedTreePrimitives
- Defined in:
- lib/tree_haver/contracts.rb
Instance Attribute Summary collapse
-
#child_order ⇒ Object
Returns the value of attribute child_order.
-
#diagnostics ⇒ Object
Returns the value of attribute diagnostics.
-
#root_id ⇒ Object
Returns the value of attribute root_id.
-
#sibling_edges ⇒ Object
Returns the value of attribute sibling_edges.
Instance Method Summary collapse
Instance Attribute Details
#child_order ⇒ Object
Returns the value of attribute child_order
259 260 261 |
# File 'lib/tree_haver/contracts.rb', line 259 def child_order @child_order end |
#diagnostics ⇒ Object
Returns the value of attribute diagnostics
259 260 261 |
# File 'lib/tree_haver/contracts.rb', line 259 def diagnostics @diagnostics end |
#root_id ⇒ Object
Returns the value of attribute root_id
259 260 261 |
# File 'lib/tree_haver/contracts.rb', line 259 def root_id @root_id end |
#sibling_edges ⇒ Object
Returns the value of attribute sibling_edges
259 260 261 |
# File 'lib/tree_haver/contracts.rb', line 259 def sibling_edges @sibling_edges end |
Instance Method Details
#to_h ⇒ Object
260 261 262 263 264 265 266 267 |
# File 'lib/tree_haver/contracts.rb', line 260 def to_h { root_id: root_id, child_order: child_order || {}, sibling_edges: (sibling_edges || []).map(&:to_h), diagnostics: diagnostics || [] } end |