Class: Workflow::Event
- Inherits:
-
Object
- Object
- Workflow::Event
- Defined in:
- lib/workflow/event.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#name ⇒ Object
Returns the value of attribute name.
-
#transitions_to ⇒ Object
Returns the value of attribute transitions_to.
Instance Method Summary collapse
- #draw(graph, from_state) ⇒ Object
-
#initialize(name, transitions_to, meta = {}, &action) ⇒ Event
constructor
A new instance of Event.
- #to_s ⇒ Object
Constructor Details
#initialize(name, transitions_to, meta = {}, &action) ⇒ Event
Returns a new instance of Event.
6 7 8 |
# File 'lib/workflow/event.rb', line 6 def initialize(name, transitions_to, = {}, &action) @name, @transitions_to, @meta, @action = name, transitions_to.to_sym, , action end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
4 5 6 |
# File 'lib/workflow/event.rb', line 4 def action @action end |
#meta ⇒ Object
Returns the value of attribute meta.
4 5 6 |
# File 'lib/workflow/event.rb', line 4 def @meta end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/workflow/event.rb', line 4 def name @name end |
#transitions_to ⇒ Object
Returns the value of attribute transitions_to.
4 5 6 |
# File 'lib/workflow/event.rb', line 4 def transitions_to @transitions_to end |
Instance Method Details
#draw(graph, from_state) ⇒ Object
10 11 12 |
# File 'lib/workflow/event.rb', line 10 def draw(graph, from_state) graph.add_edges(from_state.name.to_s, transitions_to.to_s, .merge(:label => to_s)) end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/workflow/event.rb', line 14 def to_s @name.to_s end |