class AWS::S3::UploadedPartCollection

Represents the collection of parts that have been uploaded for a given multipart upload. You can get an instance of this class by calling {AWS::S3::MultipartUpload#parts}.

@example Get the total size of the uploaded parts

upload.parts.inject(0) { |sum, part| sum + part.size }

Attributes

upload[R]

@return [MultipartUpload] The upload to which the parts belong.

Public Class Methods

new(upload, opts = {}) click to toggle source

@private

# File lib/aws/s3/uploaded_part_collection.rb, line 33
def initialize(upload, opts = {})
  @upload = upload
  super
end

Public Instance Methods

[](number) click to toggle source

@return [UploadedPart] An object representing the part with

the given part number.

@param [Integer] number The part number.

# File lib/aws/s3/uploaded_part_collection.rb, line 42
def [](number)
  UploadedPart.new(upload, number)
end

Protected Instance Methods

each_member_in_page(page) { |part| ... } click to toggle source

@private

# File lib/aws/s3/uploaded_part_collection.rb, line 48
def each_member_in_page(page, &block)
  page.parts.each do |part_info|
    part = UploadedPart.new(upload, part_info.part_number)
    yield(part)
  end
end
limit_param() click to toggle source

@private

# File lib/aws/s3/uploaded_part_collection.rb, line 67
def limit_param; :max_parts; end
list_options(options) click to toggle source

@private

# File lib/aws/s3/uploaded_part_collection.rb, line 57
def list_options(options)
  opts = super
  opts.merge!(:bucket_name => upload.object.bucket.name,
              :key => upload.object.key,
              :upload_id => upload.id)
  opts
end
list_request(options) click to toggle source

@private

# File lib/aws/s3/uploaded_part_collection.rb, line 71
def list_request(options)
  client.list_parts(options)
end
pagination_markers() click to toggle source

@private

# File lib/aws/s3/uploaded_part_collection.rb, line 77
def pagination_markers
  [:part_number_marker]
end