Class: Map::Tube::Graphviz

Inherits:
Object
  • Object
show all
Defined in:
lib/map/tube/graphviz.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#gObject

Returns the value of attribute g.



4
5
6
# File 'lib/map/tube/graphviz.rb', line 4

def g
  @g
end

#graphObject

Returns the value of attribute graph.



4
5
6
# File 'lib/map/tube/graphviz.rb', line 4

def graph
  @graph
end

Instance Method Details

#generateObject



11
12
13
14
# File 'lib/map/tube/graphviz.rb', line 11

def generate
  @g.add(@graph.to_h)
  @g
end