You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::EventStream::Message

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-eventstream/lib/aws-eventstream/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Message

Returns a new instance of Message



5
6
7
8
# File 'gems/aws-eventstream/lib/aws-eventstream/message.rb', line 5

def initialize(options)
  @headers = options[:headers] || {}
  @payload = options[:payload] || StringIO.new
end

Instance Attribute Details

#headersHash (readonly)

Returns headers of a message

Returns:

  • (Hash)

    headers of a message



11
12
13
# File 'gems/aws-eventstream/lib/aws-eventstream/message.rb', line 11

def headers
  @headers
end

#payloadIO (readonly)

Returns payload of a message, size not exceed 16MB. StringIO is returned for <= 1MB payload Tempfile is returned for > 1MB payload

Returns:

  • (IO)

    payload of a message, size not exceed 16MB. StringIO is returned for <= 1MB payload Tempfile is returned for > 1MB payload



16
17
18
# File 'gems/aws-eventstream/lib/aws-eventstream/message.rb', line 16

def payload
  @payload
end