Class: TreeGraph::TopDown

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

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



70
71
72
73
# File 'lib/tree_graph.rb', line 70

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

#tree_graphObject



66
67
68
# File 'lib/tree_graph.rb', line 66

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