Class: Constree::NodeWithAncestors

Inherits:
Node
  • Object
show all
Defined in:
lib/constree/node.rb

Instance Attribute Summary

Attributes inherited from Node

#constant, #name, #parent, #ref

Instance Method Summary collapse

Methods inherited from Node

#==, #children_for_tree_graph, #css_for_tree_html, #display_name, #full_name, #label_for_tree_graph, #label_for_tree_html, #not_yet?, #sub_nodes, #top?, #verbose

Instance Method Details

#typeObject



88
89
90
91
92
# File 'lib/constree/node.rb', line 88

def type
  return "#{ref.full_name}" if ref
  return "(#{constant.class.to_s})" unless Class === constant
  "< " + constant.ancestors[1..].map(&:to_s).join(" < ")
end