Class: EndState::Graph

Inherits:
GraphViz
  • Object
show all
Defined in:
lib/end_state/graph.rb,
lib/end_state/no_graph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(machine, event_labels = true) ⇒ Graph



5
6
7
8
9
10
# File 'lib/end_state/graph.rb', line 5

def initialize(machine, event_labels=true)
  @machine = machine
  @nodes = {}
  @event_labels = event_labels
  super machine.name.to_sym
end

Instance Attribute Details

#event_labelsObject (readonly)

Returns the value of attribute event_labels.



3
4
5
# File 'lib/end_state/graph.rb', line 3

def event_labels
  @event_labels
end

#machineObject (readonly)

Returns the value of attribute machine.



3
4
5
# File 'lib/end_state/graph.rb', line 3

def machine
  @machine
end

#nodesObject (readonly)

Returns the value of attribute nodes.



3
4
5
# File 'lib/end_state/graph.rb', line 3

def nodes
  @nodes
end

Instance Method Details

#drawObject



12
13
14
15
# File 'lib/end_state/graph.rb', line 12

def draw
  add_transitions
  self
end