Class: Fog::Rackspace::Files::Directory

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/rackspace/models/files/directory.rb

Instance Attribute Summary

Attributes inherited from Model

#connection

Instance Method Summary collapse

Methods inherited from Model

#_dump, _load, aliases, attribute, attributes, #attributes, #collection, identity, #identity, #initialize, #inspect, #merge_attributes, #new_record?, #reload, #requires, #to_json, #wait_for

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



14
15
16
17
18
19
20
# File 'lib/fog/rackspace/models/files/directory.rb', line 14

def destroy
  requires :name
  connection.delete_container(@name)
  true
rescue Excon::Errors::NotFound
  false
end

#filesObject



22
23
24
25
26
27
28
29
# File 'lib/fog/rackspace/models/files/directory.rb', line 22

def files
  @files ||= begin
    Fog::Rackspace::Files::Files.new(
      :directory    => self,
      :connection   => connection
    )
  end
end

#saveObject



31
32
33
34
35
# File 'lib/fog/rackspace/models/files/directory.rb', line 31

def save
  requires :name
  connection.put_container(@name)
  true
end