Class: Fog::AWS::Storage::File::PartList

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/aws/models/storage/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(parts = []) ⇒ PartList

Returns a new instance of PartList.



41
42
43
44
# File 'lib/fog/aws/models/storage/file.rb', line 41

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

Instance Method Details

#clear!Object



54
55
56
# File 'lib/fog/aws/models/storage/file.rb', line 54

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

#push(part) ⇒ Object



46
47
48
# File 'lib/fog/aws/models/storage/file.rb', line 46

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

#shiftObject



50
51
52
# File 'lib/fog/aws/models/storage/file.rb', line 50

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

#sizeObject



58
59
60
# File 'lib/fog/aws/models/storage/file.rb', line 58

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

#to_aObject



62
63
64
# File 'lib/fog/aws/models/storage/file.rb', line 62

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