Class: TreeGraph::BottomUp

Inherits:
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



95
96
97
98
# File 'lib/tree_graph.rb', line 95

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

#tree_graphObject



91
92
93
# File 'lib/tree_graph.rb', line 91

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