Class: Workflow::Specification
- Inherits:
-
Object
- Object
- Workflow::Specification
- Defined in:
- lib/workflow.rb
Instance Attribute Summary collapse
-
#initial_state ⇒ Object
Returns the value of attribute initial_state.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#on_failed_transition_proc ⇒ Object
Returns the value of attribute on_failed_transition_proc.
-
#on_transition_proc ⇒ Object
Returns the value of attribute on_transition_proc.
-
#states ⇒ Object
Returns the value of attribute states.
Instance Method Summary collapse
-
#initialize(meta = {}, &specification) ⇒ Specification
constructor
A new instance of Specification.
- #state_names ⇒ Object
Constructor Details
#initialize(meta = {}, &specification) ⇒ Specification
Returns a new instance of Specification.
14 15 16 17 18 |
# File 'lib/workflow.rb', line 14 def initialize( = {}, &specification) @states = Hash.new @meta = instance_eval(&specification) end |
Instance Attribute Details
#initial_state ⇒ Object
Returns the value of attribute initial_state.
12 13 14 |
# File 'lib/workflow.rb', line 12 def initial_state @initial_state end |
#meta ⇒ Object
Returns the value of attribute meta.
12 13 14 |
# File 'lib/workflow.rb', line 12 def @meta end |
#on_failed_transition_proc ⇒ Object
Returns the value of attribute on_failed_transition_proc.
12 13 14 |
# File 'lib/workflow.rb', line 12 def on_failed_transition_proc @on_failed_transition_proc end |
#on_transition_proc ⇒ Object
Returns the value of attribute on_transition_proc.
12 13 14 |
# File 'lib/workflow.rb', line 12 def on_transition_proc @on_transition_proc end |
#states ⇒ Object
Returns the value of attribute states.
12 13 14 |
# File 'lib/workflow.rb', line 12 def states @states end |
Instance Method Details
#state_names ⇒ Object
20 21 22 |
# File 'lib/workflow.rb', line 20 def state_names states.keys end |