Class: TreeGraph::BottomUp

Inherits:
Object
  • Object
show all
Includes:
Node
Defined in:
lib/tree_graph.rb

Direct Known Subclasses

BottomUpInSameOrder

Instance Attribute Summary

Attributes included from Node

#is_last, #parent, #raw_node

Instance Method Summary collapse

Methods included from Node

#ancestors, #children, #children_nodes, #indent, #initialize, #level, #levels

Instance Method Details

#branchObject



83
84
85
86
# File 'lib/tree_graph.rb', line 83

def branch
  return '' unless parent
  is_last ? '┌─' : '├─'
end

#tree_graphObject



79
80
81
# File 'lib/tree_graph.rb', line 79

def tree_graph
  levels.reverse.join("\n")
end