Class: S3::Bucket
- Inherits:
-
Driver::Model
- Object
- Driver::Model
- S3::Bucket
- Defined in:
- lib/s3/client/model/bucket.rb
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(api, bucket_name) ⇒ Bucket
constructor
A new instance of Bucket.
- #name ⇒ Object
- #objects(prefix: nil) ⇒ Object
Constructor Details
#initialize(api, bucket_name) ⇒ Bucket
Returns a new instance of Bucket.
3 4 5 6 |
# File 'lib/s3/client/model/bucket.rb', line 3 def initialize(api, bucket_name) super(api) @name = bucket_name end |
Instance Method Details
#delete ⇒ Object
12 13 14 |
# File 'lib/s3/client/model/bucket.rb', line 12 def delete @api.delete_bucket(@name) end |
#name ⇒ Object
8 9 10 |
# File 'lib/s3/client/model/bucket.rb', line 8 def name @name end |
#objects(prefix: nil) ⇒ Object
16 17 18 |
# File 'lib/s3/client/model/bucket.rb', line 16 def objects(prefix: nil) S3::ObjectCollection.new(@api, @name) end |