Class: Fog::Storage::OpenStack::Directory
- Inherits:
-
Model
- Object
- Model
- Fog::Storage::OpenStack::Directory
- Defined in:
- lib/fog/openstack/models/storage/directory.rb
Instance Attribute Summary collapse
-
#public ⇒ Object
writeonly
Sets the attribute public.
Instance Method Summary collapse
Instance Attribute Details
#public=(value) ⇒ Object (writeonly)
Sets the attribute public
13 14 15 |
# File 'lib/fog/openstack/models/storage/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/models/storage/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/models/storage/directory.rb', line 23 def files @files ||= begin Fog::Storage::OpenStack::Files.new( :directory => self, :service => service ) end end |
#public_url ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/fog/openstack/models/storage/directory.rb', line 32 def public_url requires :key @public_url ||= begin service.public_url(key) rescue Fog::Storage::OpenStack::NotFound => err nil end end |
#save ⇒ Object
42 43 44 45 46 |
# File 'lib/fog/openstack/models/storage/directory.rb', line 42 def save requires :key service.put_container(key, :public => @public) true end |