Class: Fog::Storage::AWS::Versions

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

Instance Method Summary collapse

Instance Method Details

#all(options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/fog/aws/models/storage/versions.rb', line 13

def all(options = {})
  data = if file
    service.get_bucket_object_versions(file.directory.key, options.merge('prefix' => file.key)).body['Versions']
  else
    service.get_bucket_object_versions(directory.key, options).body['Versions']
  end

  load(data)
end

#new(attributes = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/fog/aws/models/storage/versions.rb', line 23

def new(attributes = {})
  version_type = attributes.keys.first

  model = super(attributes[version_type])
  model.delete_marker = version_type == 'DeleteMarker'

  model
end