Class: Jsm::Drawer::Graphviz

Inherits:
Object
  • Object
show all
Defined in:
lib/jsm/drawer/graphviz.rb

Constant Summary collapse

API_URL =
"https://chart.googleapis.com/chart"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state_machine) ⇒ Graphviz

Returns a new instance of Graphviz.



7
8
9
10
# File 'lib/jsm/drawer/graphviz.rb', line 7

def initialize(state_machine)
  @state_machine = state_machine
  @diagraph = Jsm::Drawer::Digraph.new(@state_machine)
end

Class Method Details

.generate_url(state_machine) ⇒ Object



3
4
5
# File 'lib/jsm/drawer/graphviz.rb', line 3

def self.generate_url(state_machine)
  new(state_machine).generate_url
end

Instance Method Details

#generate_urlObject



12
13
14
15
# File 'lib/jsm/drawer/graphviz.rb', line 12

def generate_url
  diagram = @diagraph
  "#{API_URL}?cht=gv&chl=digraph{#{diagram}}"
end