Module: FlowMachine::WorkflowState::ClassMethods
- Included in:
- FlowMachine::WorkflowState
- Defined in:
- lib/flow_machine/workflow_state.rb
Instance Attribute Summary collapse
-
#expose_to_workflow_methods ⇒ Object
Returns the value of attribute expose_to_workflow_methods.
-
#state_callbacks ⇒ Object
Returns the value of attribute state_callbacks.
Instance Method Summary collapse
- #event(name, options = {}, &block) ⇒ Object
-
#expose_to_workflow(name) ⇒ Object
Maintains a list of methods that should be exposed to the workflow the workflow is responsible for reading this list.
- #state_name ⇒ Object
Instance Attribute Details
#expose_to_workflow_methods ⇒ Object
Returns the value of attribute expose_to_workflow_methods.
12 13 14 |
# File 'lib/flow_machine/workflow_state.rb', line 12 def expose_to_workflow_methods @expose_to_workflow_methods end |
#state_callbacks ⇒ Object
Returns the value of attribute state_callbacks.
11 12 13 |
# File 'lib/flow_machine/workflow_state.rb', line 11 def state_callbacks @state_callbacks end |
Instance Method Details
#event(name, options = {}, &block) ⇒ Object
25 26 27 28 29 |
# File 'lib/flow_machine/workflow_state.rb', line 25 def event(name, = {}, &block) define_may_event(name, ) define_event(name, , &block) define_event_bang(name) end |
#expose_to_workflow(name) ⇒ Object
Maintains a list of methods that should be exposed to the workflow the workflow is responsible for reading this list
20 21 22 23 |
# File 'lib/flow_machine/workflow_state.rb', line 20 def expose_to_workflow(name) self.expose_to_workflow_methods ||= [] self.expose_to_workflow_methods << name end |
#state_name ⇒ Object
14 15 16 |
# File 'lib/flow_machine/workflow_state.rb', line 14 def state_name name.demodulize.sub(/State\z/, '').underscore.to_sym end |