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.
160 161 162 163 164 165 166 167 168 |
# File 'lib/simplerubysteps/model.rb', line 160 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.
158 159 160 |
# File 'lib/simplerubysteps/model.rb', line 158 def @iam_permissions end |
Instance Method Details
#action(&action_block) ⇒ Object
170 171 172 |
# File 'lib/simplerubysteps/model.rb', line 170 def action(&action_block) @action_block = action_block end |
#implicit_choice ⇒ Object
187 188 189 190 191 192 193 194 |
# File 'lib/simplerubysteps/model.rb', line 187 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
174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/simplerubysteps/model.rb', line 174 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 |