Class: Map::Tube::Graphviz
- Inherits:
-
Object
- Object
- Map::Tube::Graphviz
- Defined in:
- lib/map/tube/graphviz.rb
Instance Attribute Summary collapse
-
#g ⇒ Object
Returns the value of attribute g.
-
#graph ⇒ Object
Returns the value of attribute graph.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(graph) ⇒ Graphviz
constructor
A new instance of Graphviz.
Constructor Details
#initialize(graph) ⇒ Graphviz
Returns a new instance of Graphviz.
6 7 8 9 |
# File 'lib/map/tube/graphviz.rb', line 6 def initialize(graph) @graph = graph @g = GraphViz.new(:G, type: :digraph, concentrate: true) end |
Instance Attribute Details
#g ⇒ Object
Returns the value of attribute g.
4 5 6 |
# File 'lib/map/tube/graphviz.rb', line 4 def g @g end |
#graph ⇒ Object
Returns the value of attribute graph.
4 5 6 |
# File 'lib/map/tube/graphviz.rb', line 4 def graph @graph end |
Instance Method Details
#generate ⇒ Object
11 12 13 14 |
# File 'lib/map/tube/graphviz.rb', line 11 def generate @g.add(@graph.to_h) @g end |