mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
40 lines
684 B
Ruby
40 lines
684 B
Ruby
|
module Fog
|
||
|
module Rackspace
|
||
|
class Files
|
||
|
|
||
|
class Directory < Fog::Model
|
||
|
|
||
|
identity :name
|
||
|
|
||
|
attribute :bytes
|
||
|
attribute :count
|
||
|
|
||
|
def destroy
|
||
|
requires :name
|
||
|
connection.delete_container(@name)
|
||
|
true
|
||
|
rescue Excon::Errors::NotFound
|
||
|
false
|
||
|
end
|
||
|
|
||
|
def files
|
||
|
@files ||= begin
|
||
|
Fog::Rackspace::Files::Files.new(
|
||
|
:directory => self,
|
||
|
:connection => connection
|
||
|
)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def save
|
||
|
requires :name
|
||
|
connection.put_container(@name)
|
||
|
true
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||
|
end
|