Class: Simplerubysteps::Task
- Defined in:
- lib/simplerubysteps/model.rb
Instance Attribute Summary collapse
-
#iam_permissions ⇒ Object
Returns the value of attribute iam_permissions.
Attributes inherited from State
Instance Method Summary collapse
- #action(&action_block) ⇒ Object
- #implicit_choice ⇒ Object
-
#initialize(name) ⇒ Task
constructor
A new instance of Task.
- #perform_action(input) ⇒ Object
Methods inherited from State
Constructor Details
#initialize(name) ⇒ Task
Returns a new instance of Task.
86 87 88 89 90 91 92 93 94 |
# File 'lib/simplerubysteps/model.rb', line 86 def initialize(name) super @dict[:Type] = "Task" @dict[:Resource] = pop_function_arn @dict[:Parameters] = { :Task => name, "Input.$" => "$", } end |
Instance Attribute Details
#iam_permissions ⇒ Object
Returns the value of attribute iam_permissions.
84 85 86 |
# File 'lib/simplerubysteps/model.rb', line 84 def end |
Instance Method Details
#action(&action_block) ⇒ Object
96 97 98 |
# File 'lib/simplerubysteps/model.rb', line 96 def action(&action_block) @action_block = action_block end |
#implicit_choice ⇒ Object
113 114 115 116 117 118 119 120 |
# File 'lib/simplerubysteps/model.rb', line 113 def implicit_choice unless @implicit_choice @implicit_choice = Choice.new("#{name}_choice") $sm.add @implicit_choice self.next = @implicit_choice end @implicit_choice end |
#perform_action(input) ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/simplerubysteps/model.rb', line 100 def perform_action(input) output = input # default: pass through output = @action_block.call(input) if @action_block if @implicit_choice output = {} unless output @implicit_choice.perform_action(output) end output end |