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 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.



232
233
234
235
236
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 232

def initialize(parts, progress_callback)
  @bytes_sent = Array.new(parts.size, 0)
  @total_sizes = parts.part_sizes
  @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.



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

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