Class: ScbiGo::AncestorsGraph
- Defined in:
- lib/scbi_go/ancestors_graph.rb
Instance Method Summary collapse
-
#build_dot_lines(nodes) ⇒ Object
override the way that nodes are painted in dot.
Methods inherited from BaseGraph
Constructor Details
This class inherits a constructor from ScbiGo::BaseGraph
Instance Method Details
#build_dot_lines(nodes) ⇒ Object
override the way that nodes are painted in dot
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/scbi_go/ancestors_graph.rb', line 5 def build_dot_lines(nodes) res =[] res << "digraph #{@graph_name} {" nodes.each do |node| res << "#{node.id.gsub(':','_')}[label=\"#{node.id}\n#{node.name}\"];" end nodes.each do |node| node.is_a.each do |parent| res << "#{parent.id.gsub(':','_')} -> #{node.id.gsub(':','_')} ;" end end res << "}" return res end |