Class: Workflow::Specification
- Inherits:
-
Object
- Object
- Workflow::Specification
- Defined in:
- lib/workflow/specification.rb
Instance Attribute Summary collapse
-
#after_transition_proc ⇒ Object
Returns the value of attribute after_transition_proc.
-
#before_transition_proc ⇒ Object
Returns the value of attribute before_transition_proc.
-
#initial_state ⇒ Object
Returns the value of attribute initial_state.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#on_error_proc ⇒ Object
Returns the value of attribute on_error_proc.
-
#on_transition_proc ⇒ Object
Returns the value of attribute on_transition_proc.
-
#on_unavailable_transition_proc ⇒ Object
Returns the value of attribute on_unavailable_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.
13 14 15 16 17 |
# File 'lib/workflow/specification.rb', line 13 def initialize( = {}, &specification) @states = Hash.new @meta = instance_eval(&specification) end |
Instance Attribute Details
#after_transition_proc ⇒ Object
Returns the value of attribute after_transition_proc.
9 10 11 |
# File 'lib/workflow/specification.rb', line 9 def after_transition_proc @after_transition_proc end |
#before_transition_proc ⇒ Object
Returns the value of attribute before_transition_proc.
9 10 11 |
# File 'lib/workflow/specification.rb', line 9 def before_transition_proc @before_transition_proc end |
#initial_state ⇒ Object
Returns the value of attribute initial_state.
9 10 11 |
# File 'lib/workflow/specification.rb', line 9 def initial_state @initial_state end |
#meta ⇒ Object
Returns the value of attribute meta.
9 10 11 |
# File 'lib/workflow/specification.rb', line 9 def @meta end |
#on_error_proc ⇒ Object
Returns the value of attribute on_error_proc.
9 10 11 |
# File 'lib/workflow/specification.rb', line 9 def on_error_proc @on_error_proc end |
#on_transition_proc ⇒ Object
Returns the value of attribute on_transition_proc.
9 10 11 |
# File 'lib/workflow/specification.rb', line 9 def on_transition_proc @on_transition_proc end |
#on_unavailable_transition_proc ⇒ Object
Returns the value of attribute on_unavailable_transition_proc.
9 10 11 |
# File 'lib/workflow/specification.rb', line 9 def on_unavailable_transition_proc @on_unavailable_transition_proc end |
#states ⇒ Object
Returns the value of attribute states.
9 10 11 |
# File 'lib/workflow/specification.rb', line 9 def states @states end |
Instance Method Details
#state_names ⇒ Object
19 20 21 |
# File 'lib/workflow/specification.rb', line 19 def state_names states.keys end |