Class: AWS::Flow::Templates::FlowDefaultResultActivityRuby

Inherits:
Object
  • Object
show all
Extended by:
Activities
Defined in:
lib/aws/templates/default.rb

Overview

Default result reporting activity class for the AWS Flow Framework for Ruby

Instance Attribute Summary

Attributes included from Activities

#activities, #activity_client

Attributes included from Utilities::UpwardLookups

#precursors

Instance Method Summary collapse

Methods included from Activities

_options, activity, extended, look_upwards

Methods included from Utilities::UpwardLookups

#held_properties, #properties, #property

Constructor Details

#initialize(writer = nil) ⇒ FlowDefaultResultActivityRuby

Returns a new instance of FlowDefaultResultActivityRuby.

Parameters:

  • writer (defaults to: nil)

    IO An optional IO file descripter to write the result to.



120
121
122
# File 'lib/aws/templates/default.rb', line 120

def initialize(writer=nil)
  @writer = writer
end

Instance Method Details

#run(input) ⇒ Object

Serialize the input and write it to an IO writer if provided



125
126
127
128
129
130
131
# File 'lib/aws/templates/default.rb', line 125

def run(input)
  unless input.is_a?(Hash) && input.include?(:key) && input.include?(:result)
    raise ArgumentError, "Incorrect input format for "\
      "FlowDefaultResultActivityRuby.run"
  end
  @writer.puts Marshal.dump(input) if @writer
end