Class: Fog::OpenStack::Storage::Directory
- Inherits:
-
Model
- Object
- Model
- Model
- Fog::OpenStack::Storage::Directory
show all
- Defined in:
- lib/fog/openstack/storage/models/directory.rb
Instance Attribute Summary collapse
Attributes inherited from Model
#project
Instance Method Summary
collapse
Methods inherited from Model
#create, #initialize, #update
Instance Attribute Details
#public=(value) ⇒ Object
Sets the attribute public
13
14
15
|
# File 'lib/fog/openstack/storage/models/directory.rb', line 13
def public=(value)
@public = value
end
|
Instance Method Details
#destroy ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/fog/openstack/storage/models/directory.rb', line 15
def destroy
requires :key
service.delete_container(key)
true
rescue Excon::Errors::NotFound
false
end
|
#files ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/fog/openstack/storage/models/directory.rb', line 23
def files
@files ||= begin
Fog::OpenStack::Storage::Files.new(
:directory => self,
:service => service
)
end
end
|
#public_url ⇒ Object
32
33
34
35
36
37
38
39
40
|
# File 'lib/fog/openstack/storage/models/directory.rb', line 32
def public_url
requires :key
@public_url ||= begin
service.public_url(key)
rescue Fog::OpenStack::Storage::NotFound => err
nil
end
end
|
#save ⇒ Object
42
43
44
45
46
|
# File 'lib/fog/openstack/storage/models/directory.rb', line 42
def save
requires :key
service.put_container(key, :public => @public)
true
end
|