Class: Fog::Google::Storage::Directory
- Extended by:
- Deprecation
- Defined in:
- lib/fog/google/models/storage/directory.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
Methods included from Deprecation
Methods inherited from Model
#initialize, #inspect, #reload, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #identity, #identity=, #merge_attributes, #new_record?, #requires
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#acl=(new_acl) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/fog/google/models/storage/directory.rb', line 17 def acl=(new_acl) valid_acls = ['private', 'public-read', 'public-read-write', 'authenticated-read'] unless valid_acls.include?(new_acl) raise ArgumentError.new("acl must be one of [#{valid_acls.join(', ')}]") end @acl = new_acl end |
#destroy ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/fog/google/models/storage/directory.rb', line 25 def destroy requires :key connection.delete_bucket(key) true rescue Excon::Errors::NotFound false end |
#files ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/fog/google/models/storage/directory.rb', line 33 def files @files ||= begin Fog::Google::Storage::Files.new( :directory => self, :connection => connection ) end end |
#save ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fog/google/models/storage/directory.rb', line 42 def save requires :key = {} if @acl ['x-amz-acl'] = @acl end if @location ['LocationConstraint'] = @location end connection.put_bucket(key, ) true end |