Module: SimpleStateMachine::Tools::Graphviz

Included in:
StateMachineDefinition
Defined in:
lib/simple_state_machine/tools/graphviz.rb

Instance Method Summary collapse

Instance Method Details

#google_chart_urlObject

Generates a url that renders states and events as a directional graph. See code.google.com/apis/chart/docs/gallery/graphviz.html



12
13
14
# File 'lib/simple_state_machine/tools/graphviz.rb', line 12

def google_chart_url
  "http://chart.googleapis.com/chart?cht=gv&chl=digraph{#{::CGI.escape to_graphviz_dot}}"
end

#to_graphviz_dotObject

Graphviz dot format for rendering as a directional graph



6
7
8
# File 'lib/simple_state_machine/tools/graphviz.rb', line 6

def to_graphviz_dot
  transitions.map { |t| t.to_graphviz_dot }.sort.join(";")
end