1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/models/files/directory.rb

40 lines
684 B
Ruby
Raw Normal View History

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