Module: AWS::Flow::Core::SimpleDFA Private
- Included in:
- BeginRescueEnsure
- Defined in:
- lib/aws/flow/simple_dfa.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Contains a data flow analysis (DFA)-like framework, where transition functions can perform arbitrary computation before moving to the next state.
Defined Under Namespace
Modules: InstanceMethods
Instance Attribute Summary collapse
- #start_state ⇒ Object private
- #states ⇒ Object private
- #symbols ⇒ Object private
- #transitions ⇒ Object private
Instance Method Summary collapse
- #add_transition(state, symbol, &block) ⇒ Object private
- #define_general(state, &block) ⇒ Object private
-
#get_start_state ⇒ Object
private
The start state The start state that was provided when this instance was created.
-
#get_transitions ⇒ Array
private
The list of all transitions that were added with #add_transition.
-
#init(start_state) ⇒ Object
private
Creates a new ‘SimpleDFA` instance.
- #uncovered_transitions ⇒ Object private
Instance Attribute Details
#start_state ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/aws/flow/simple_dfa.rb', line 24 def start_state @start_state end |
#states ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/aws/flow/simple_dfa.rb', line 24 def states @states end |
#symbols ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/aws/flow/simple_dfa.rb', line 24 def symbols @symbols end |
#transitions ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/aws/flow/simple_dfa.rb', line 24 def transitions @transitions end |
Instance Method Details
#add_transition(state, symbol, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
67 68 69 70 71 |
# File 'lib/aws/flow/simple_dfa.rb', line 67 def add_transition(state, symbol, &block) @symbols << symbol unless @symbols.include? symbol @states << state unless @states.include? state @transitions[[state, symbol]] = block end |
#define_general(state, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
58 59 60 61 62 63 64 |
# File 'lib/aws/flow/simple_dfa.rb', line 58 def define_general(state, &block) @symbols.each do |symbol| if @transitions[[state, symbol]].nil? @transitions[[state, symbol]] = block end end end |
#get_start_state ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the start state The start state that was provided when this instance was created.
45 46 47 |
# File 'lib/aws/flow/simple_dfa.rb', line 45 def get_start_state @start_state end |
#get_transitions ⇒ Array
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The list of all transitions that were added with #add_transition.
53 54 55 |
# File 'lib/aws/flow/simple_dfa.rb', line 53 def get_transitions @transitions end |
#init(start_state) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new ‘SimpleDFA` instance.
32 33 34 35 36 37 38 39 |
# File 'lib/aws/flow/simple_dfa.rb', line 32 def init(start_state) include InstanceMethods @start_state = start_state @symbols = [] @states = [] @transitions = {} @states << start_state end |
#uncovered_transitions ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
74 75 76 |
# File 'lib/aws/flow/simple_dfa.rb', line 74 def uncovered_transitions @states.product(@symbols) - @transitions.keys end |