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.
13 14 15 |
# File 'lib/flow_machine/workflow_state.rb', line 13 def expose_to_workflow_methods @expose_to_workflow_methods end |
#state_callbacks ⇒ Object
Returns the value of attribute state_callbacks.
12 13 14 |
# File 'lib/flow_machine/workflow_state.rb', line 12 def state_callbacks @state_callbacks end |
Instance Method Details
#event(name, options = {}, &block) ⇒ Object
26 27 28 29 30 |
# File 'lib/flow_machine/workflow_state.rb', line 26 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
21 22 23 24 |
# File 'lib/flow_machine/workflow_state.rb', line 21 def expose_to_workflow(name) self.expose_to_workflow_methods ||= [] self.expose_to_workflow_methods << name end |
#state_name ⇒ Object
15 16 17 |
# File 'lib/flow_machine/workflow_state.rb', line 15 def state_name name.demodulize.sub(/State\z/, "").underscore.to_sym end |