Class: Rumbly::Diagram::Graphviz

Inherits:
Base
  • Object
show all
Defined in:
lib/rumbly/diagram/graphviz.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#application

Instance Method Summary collapse

Methods inherited from Base

#build, create, #initialize

Constructor Details

This class inherits a constructor from Rumbly::Diagram::Base

Instance Attribute Details

#graphObject (readonly)

Returns the value of attribute graph.



10
11
12
# File 'lib/rumbly/diagram/graphviz.rb', line 10

def graph
  @graph
end

Instance Method Details

#find(klass) ⇒ Object



32
33
34
# File 'lib/rumbly/diagram/graphviz.rb', line 32

def find (klass)
  get_node(klass.name)
end

#finishObject



36
37
38
39
# File 'lib/rumbly/diagram/graphviz.rb', line 36

def finish
  d = Rumbly::options.diagram
  output(d.format => "#{d.file}.#{d.format}")
end

#middleObject



25
26
# File 'lib/rumbly/diagram/graphviz.rb', line 25

def middle
end

#process_klass(k) ⇒ Object



21
22
23
# File 'lib/rumbly/diagram/graphviz.rb', line 21

def process_klass (k)
  add_nodes(k.name)
end

#process_relationship(r) ⇒ Object



28
29
30
# File 'lib/rumbly/diagram/graphviz.rb', line 28

def process_relationship (r)
  add_edges(find(r.source), find(r.target))
end

#setupObject



14
15
16
17
18
19
# File 'lib/rumbly/diagram/graphviz.rb', line 14

def setup
  @graph = GraphViz.digraph(@application.name)
  @graph.node[:shape] = :record
  @graph.node[:fontsize] = 10
  @graph.node[:fontname] = 'Arial'
end