Class: Simplerubysteps::Callback

Inherits:
State
  • Object
show all
Defined in:
lib/simplerubysteps/model.rb

Instance Attribute Summary

Attributes inherited from State

#name, #state_machine

Instance Method Summary collapse

Methods inherited from State

#[]=, #next=, #render

Constructor Details

#initialize(name) ⇒ Callback

Returns a new instance of Callback.



118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/simplerubysteps/model.rb', line 118

def initialize(name)
  super
  @dict[:Type] = "Task"
  @dict[:Resource] = "arn:aws:states:::lambda:invoke.waitForTaskToken"
  @dict[:Parameters] = {
    :FunctionName => pop_function_name,
    :Payload => {
      :Task => name,
      "Input.$" => "$",
      "Token.$" => "$$.Task.Token",
    },
  }
end

Instance Method Details

#action(&action_block) ⇒ Object



132
133
134
# File 'lib/simplerubysteps/model.rb', line 132

def action(&action_block)
  @action_block = action_block
end

#perform_action(input, token) ⇒ Object



136
137
138
# File 'lib/simplerubysteps/model.rb', line 136

def perform_action(input, token)
  @action_block.call(input, token) if @action_block
end