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.



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

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.



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

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.



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

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