Module: AWS::Flow::DecisionStateMachineDFA::InstanceMethods

Defined in:
lib/aws/decider/state_machines.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_stateObject

Returns the value of attribute current_state.



65
66
67
# File 'lib/aws/decider/state_machines.rb', line 65

def current_state
  @current_state
end

Instance Method Details

#consume(symbol) ⇒ Object



67
68
69
70
71
72
73
74
75
76
# File 'lib/aws/decider/state_machines.rb', line 67

def consume(symbol)
  @state_history ||= [self.class.get_start_state]
  @state_history << @current_state
  @state_history << symbol
  transition_tuple = self.class.get_transitions[[@current_state, symbol]]
  raise "This is not a legal transition, attempting to consume #{symbol} while at state #{current_state}" unless transition_tuple
  @current_state, func_to_call = transition_tuple
  @state_history << @current_state
  func_to_call.call(self) if func_to_call
end