Class: AWS::Flow::Templates::ResultActivityTemplate Private

Inherits:
ActivityTemplate show all
Defined in:
lib/aws/templates/activity.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This template represents a Result Activity in SWF.

Instance Attribute Summary collapse

Attributes inherited from ActivityTemplate

#name, #options

Instance Method Summary collapse

Constructor Details

#initialize(key, opts = {}) ⇒ ResultActivityTemplate

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 a new instance of ResultActivityTemplate.



71
72
73
74
75
76
77
78
79
# File 'lib/aws/templates/activity.rb', line 71

def initialize(key, opts = {})
  @key = key

  # Get the name of the result activity
  name = "#{FlowConstants.defaults[:result_activity_prefix]}."\
    "#{FlowConstants.defaults[:result_activity_method]}"

  super(name, opts)
end

Instance Attribute Details

#keyObject (readonly)

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.



69
70
71
# File 'lib/aws/templates/activity.rb', line 69

def key
  @key
end

Instance Method Details

#run(input, context) ⇒ 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.

Wraps the input into a result hash and calls the ActivityTemplate#run method to report the result



83
84
85
86
87
88
# File 'lib/aws/templates/activity.rb', line 83

def run(input, context)
  result = {}
  result[:key] = @key
  result[:result] = input
  super(result, context)
end