Module: Dynflow::Stateful
- Included in:
 - ExecutionPlan, ExecutionPlan::Steps::Abstract
 
- Defined in:
 - lib/dynflow/stateful.rb
 
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
- 
  
    
      #state  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute state.
 
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state.
      27 28 29  | 
    
      # File 'lib/dynflow/stateful.rb', line 27 def state @state end  | 
  
Class Method Details
.included(base) ⇒ Object
      5 6 7  | 
    
      # File 'lib/dynflow/stateful.rb', line 5 def self.included(base) base.extend ClassMethods end  | 
  
Instance Method Details
#set_state(state, skip_transition_check) ⇒ Object
      33 34 35 36 37 38 39 40  | 
    
      # File 'lib/dynflow/stateful.rb', line 33 def set_state(state, skip_transition_check) state = state.to_sym if state.is_a?(String) && states.map(&:to_s).include?(state) raise "unknown state #{state}" unless states.include? state unless self.state.nil? || skip_transition_check || state_transitions.fetch(self.state).include?(state) raise "invalid state transition #{self.state} >> #{state} in #{self}" end @state = state end  | 
  
#state_transitions ⇒ Object
      23 24 25  | 
    
      # File 'lib/dynflow/stateful.rb', line 23 def state_transitions self.class.state_transitions end  | 
  
#states ⇒ Object
      19 20 21  | 
    
      # File 'lib/dynflow/stateful.rb', line 19 def states self.class.states end  |