Class: Fog::AWS::S3::Directory
Instance Attribute Summary
Attributes inherited from Model
#connection
Instance Method Summary
collapse
deprecate
Methods inherited from Model
#_dump, _load, aliases, attribute, attributes, #attributes, #collection, identity, #identity, #initialize, #inspect, #merge_attributes, #new_record?, #reload, #requires, #to_json, #wait_for
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/fog/aws/models/s3/directory.rb', line 16
def destroy
requires :key
connection.delete_bucket(key)
true
rescue Excon::Errors::NotFound
false
end
|
#files ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'lib/fog/aws/models/s3/directory.rb', line 34
def files
@files ||= begin
Fog::AWS::S3::Files.new(
:directory => self,
:connection => connection
)
end
end
|
#location ⇒ Object
24
25
26
27
28
|
# File 'lib/fog/aws/models/s3/directory.rb', line 24
def location
requires :key
data = connection.get_bucket_location(key)
data.body['LocationConstraint']
end
|
#location=(new_location) ⇒ Object
30
31
32
|
# File 'lib/fog/aws/models/s3/directory.rb', line 30
def location=(new_location)
@location = new_location
end
|
#payer ⇒ Object
43
44
45
46
47
|
# File 'lib/fog/aws/models/s3/directory.rb', line 43
def payer
requires :key
data = connection.get_request_payment(key)
data.body['Payer']
end
|
#payer=(new_payer) ⇒ Object
49
50
51
52
53
|
# File 'lib/fog/aws/models/s3/directory.rb', line 49
def payer=(new_payer)
requires :key
connection.put_request_payment(key, new_payer)
@payer = new_payer
end
|
#save ⇒ Object
55
56
57
58
59
60
61
62
63
|
# File 'lib/fog/aws/models/s3/directory.rb', line 55
def save
requires :key
options = {}
if @location
options['LocationConstraint'] = @location
end
connection.put_bucket(key, options)
true
end
|