Class: S3StreamingMultipartUploader
- Inherits:
-
Object
- Object
- S3StreamingMultipartUploader
- 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
-
#initialize(s3_client, options = {}) ⇒ S3StreamingMultipartUploader
constructor
A new instance of S3StreamingMultipartUploader.
- #stream(bucket, key, enumerator) ⇒ Object
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, = {}) @min_part_size = [: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 |