Class: Fog::AWS::S3::Bucket
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::S3::Bucket
show all
- Defined in:
- lib/fog/aws/models/s3/bucket.rb
Instance Attribute Summary
Attributes inherited from Model
#connection
Instance Method Summary
collapse
Methods inherited from Model
#_dump, _load, aliases, attribute, attributes, #attributes, #collection, identity, #identity, #initialize, #inspect, #merge_attributes, #new_record?, #reload, #requires, #wait_for
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
11
12
13
14
15
16
17
18
|
# File 'lib/fog/aws/models/s3/bucket.rb', line 11
def destroy
requires :name
connection.delete_bucket(@name)
true
rescue Excon::Errors::NotFound
false
end
|
20
21
22
23
24
25
|
# File 'lib/fog/aws/models/s3/bucket.rb', line 20
def location
requires :name
data = connection.get_bucket_location(@name)
data.body['LocationConstraint']
end
|
#location=(new_location) ⇒ Object
27
28
29
|
# File 'lib/fog/aws/models/s3/bucket.rb', line 27
def location=(new_location)
@location = new_location
end
|
31
32
33
34
35
36
37
38
|
# File 'lib/fog/aws/models/s3/bucket.rb', line 31
def objects
@objects ||= begin
Fog::AWS::S3::Objects.new(
:bucket => self,
:connection => connection
)
end
end
|
40
41
42
43
44
45
|
# File 'lib/fog/aws/models/s3/bucket.rb', line 40
def payer
requires :name
data = connection.get_request_payment(@name)
data.body['Payer']
end
|
#payer=(new_payer) ⇒ Object
47
48
49
50
51
52
|
# File 'lib/fog/aws/models/s3/bucket.rb', line 47
def payer=(new_payer)
requires :name
connection.put_request_payment(@name, new_payer)
@payer = new_payer
end
|
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/fog/aws/models/s3/bucket.rb', line 54
def save
requires :name
options = {}
if @location
options['LocationConstraint'] = @location
end
connection.put_bucket(@name, options)
true
end
|