Class: Fog::Storage::AWS::Version

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

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



25
26
27
28
29
30
31
# File 'lib/fog/aws/models/storage/version.rb', line 25

def destroy
  if collection.file
    collection.connection.delete_object(collection.file.directory.key, key, 'versionId' => version)
  else
    collection.connection.delete_object(collection.directory.key, key, 'versionId' => version)
  end
end

#fileObject



17
18
19
20
21
22
23
# File 'lib/fog/aws/models/storage/version.rb', line 17

def file
  @file ||= if collection.file
    collection.file.directory.files.get(key, 'versionId' => version)
  else
    collection.directory.files.get(key, 'versionId' => version)
  end
end