Class: Aws::S3::MultipartFileUploader::PartList 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 = []) ⇒ PartList

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



204
205
206
207
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 204

def initialize(parts = [])
  @parts = parts
  @mutex = Mutex.new
end

Instance Method Details

#clear!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.



217
218
219
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 217

def clear!
  @mutex.synchronize { @parts.clear }
end

#part_sizesObject

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.



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

def part_sizes
  @mutex.synchronize { @parts.map { |p| p[:body].size } }
end

#push(part) ⇒ 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.



209
210
211
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 209

def push(part)
  @mutex.synchronize { @parts.push(part) }
end

#shiftObject

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.



213
214
215
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 213

def shift
  @mutex.synchronize { @parts.shift }
end

#sizeObject

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.



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

def size
  @mutex.synchronize { @parts.size }
end

#to_aObject

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.



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

def to_a
  @mutex.synchronize { @parts.dup }
end