Class: OCI::ObjectStorage::Transfer::Multipart::Internal::MultipartUploadPartsCollection
- Inherits:
-
Object
- Object
- OCI::ObjectStorage::Transfer::Multipart::Internal::MultipartUploadPartsCollection
- Defined in:
- lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb
Overview
Wraps a collection of parts to be uploaded to Object Storage in order to provide thread-safe access to the collection
Instance Method Summary collapse
- #clear! ⇒ Object
-
#initialize(parts = []) ⇒ MultipartUploadPartsCollection
constructor
A new instance of MultipartUploadPartsCollection.
- #length ⇒ Object (also: #size)
- #push(part) ⇒ Object
- #shift ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(parts = []) ⇒ MultipartUploadPartsCollection
Returns a new instance of MultipartUploadPartsCollection.
12 13 14 15 |
# File 'lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb', line 12 def initialize(parts = []) @parts = parts @lock = Mutex.new end |
Instance Method Details
#clear! ⇒ Object
25 26 27 |
# File 'lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb', line 25 def clear! @lock.synchronize { @parts.clear } end |
#length ⇒ Object Also known as: size
33 34 35 |
# File 'lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb', line 33 def length @lock.synchronize { @parts.length } end |
#push(part) ⇒ Object
17 18 19 |
# File 'lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb', line 17 def push(part) @lock.synchronize { @parts.push(part) } end |
#shift ⇒ Object
21 22 23 |
# File 'lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb', line 21 def shift @lock.synchronize { @parts.shift } end |
#to_a ⇒ Object
29 30 31 |
# File 'lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb', line 29 def to_a @lock.synchronize { @parts.dup } end |