Class: Aws::S3::MultipartFileUploader::MultipartProgress Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-s3/multipart_file_uploader.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parts, progress_callback) ⇒ MultipartProgress

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MultipartProgress.



236
237
238
239
240
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 236

def initialize(parts, progress_callback)
  @bytes_sent = Array.new(parts.size, 0)
  @total_sizes = parts.part_sizes
  @progress_callback = progress_callback
end

Instance Attribute Details

#progress_callbackObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



242
243
244
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 242

def progress_callback
  @progress_callback
end

Instance Method Details

#call(part_number, bytes_read) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



244
245
246
247
248
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 244

def call(part_number, bytes_read)
  # part numbers start at 1
  @bytes_sent[part_number - 1] = bytes_read
  @progress_callback.call(@bytes_sent, @total_sizes)
end