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.



222
223
224
225
226
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 222

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.



228
229
230
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 228

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.



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

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