File: message.rb

package info (click to toggle)
ruby-aws-eventstream 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 108 kB
  • sloc: ruby: 283; makefile: 3
file content (22 lines) | stat: -rw-r--r-- 501 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Aws
  module EventStream
    class Message

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

      # @return [Hash] headers of a message
      attr_reader :headers

      # @return [IO] payload of a message, size not exceed 16MB.
      #   StringIO is returned for <= 1MB payload
      #   Tempfile is returned for > 1MB payload
      attr_reader :payload

    end
  end
end