You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: AWS::S3::UploadedPart

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/s3/uploaded_part.rb

Overview

Represents a part of a multipart upload that has been uploaded to S3.

Examples:

Get the total size of the uploaded parts

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#part_numberInteger (readonly)

Returns The part number.

Returns:

  • (Integer)

    The part number.



30
31
32
# File 'lib/aws/s3/uploaded_part.rb', line 30

def part_number
  @part_number
end

#uploadMultipartUpload (readonly)

Returns The upload to which this belongs.

Returns:



27
28
29
# File 'lib/aws/s3/uploaded_part.rb', line 27

def upload
  @upload
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



40
41
42
43
44
# File 'lib/aws/s3/uploaded_part.rb', line 40

def ==(other)
  other.kind_of?(UploadedPart) and
    other.upload == upload and
    other.part_number == part_number
end

#etagString

Returns The ETag of the part.

Returns:

  • (String)

    The ETag of the part.



60
61
62
63
# File 'lib/aws/s3/uploaded_part.rb', line 60

def etag
  @etag ||= get_attribute(:etag)
  @etag
end

#last_modifiedDateTime

Returns The time at which the part was last modified.

Returns:

  • (DateTime)

    The time at which the part was last modified.



55
56
57
# File 'lib/aws/s3/uploaded_part.rb', line 55

def last_modified
  get_attribute(:last_modified)
end

#sizeInteger

Returns The size of the part as it currently exists in S3.

Returns:

  • (Integer)

    The size of the part as it currently exists in S3.



49
50
51
# File 'lib/aws/s3/uploaded_part.rb', line 49

def size
  get_attribute(:size)
end