Class: Fog::AWS::Storage::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



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

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



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

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

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

  model
end