Class: EndState::Graph
- Inherits:
-
GraphViz
- Object
- GraphViz
- EndState::Graph
- Defined in:
- lib/end_state/graph.rb,
lib/end_state/no_graph.rb
Instance Attribute Summary collapse
-
#event_labels ⇒ Object
readonly
Returns the value of attribute event_labels.
-
#machine ⇒ Object
readonly
Returns the value of attribute machine.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(machine, event_labels = true) ⇒ Graph
constructor
A new instance of Graph.
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_labels ⇒ Object (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 |
#machine ⇒ Object (readonly)
Returns the value of attribute machine.
3 4 5 |
# File 'lib/end_state/graph.rb', line 3 def machine @machine end |
#nodes ⇒ Object (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
#draw ⇒ Object
12 13 14 15 |
# File 'lib/end_state/graph.rb', line 12 def draw add_transitions self end |