Class: S3StreamingMultipartUploader

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_streaming_multipart_uploader.rb

Defined Under Namespace

Classes: Uploader

Constant Summary collapse

MIN_PART_SIZE =
1024 * 1024 * 5

Instance Method Summary collapse

Constructor Details

#initialize(s3_client, options = {}) ⇒ S3StreamingMultipartUploader

Returns a new instance of S3StreamingMultipartUploader.



5
6
7
8
# File 'lib/s3_streaming_multipart_uploader.rb', line 5

def initialize(s3_client, options = {})
  @min_part_size = options[:min_part_size] || MIN_PART_SIZE
  @s3_client = s3_client
end

Instance Method Details

#stream(bucket, key, enumerator) ⇒ Object



10
11
12
13
# File 'lib/s3_streaming_multipart_uploader.rb', line 10

def stream(bucket, key, enumerator)
  @uploader = Uploader.new(@s3_client, bucket, key, enumerator, @min_part_size)
  @uploader.stream
end