Module: FlowMachine::WorkflowState::ClassMethods

Included in:
FlowMachine::WorkflowState
Defined in:
lib/flow_machine/workflow_state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expose_to_workflow_methodsObject

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_callbacksObject

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, options = {}, &block)
  define_may_event(name, options)
  define_event(name, options, &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_nameObject



14
15
16
# File 'lib/flow_machine/workflow_state.rb', line 14

def state_name
  name.demodulize.sub(/State\z/, '').underscore.to_sym
end