Class: S3::Bucket

Inherits:
Driver::Model
  • Object
show all
Defined in:
lib/s3/client/model/bucket.rb

Instance Method Summary collapse

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

#deleteObject



12
13
14
# File 'lib/s3/client/model/bucket.rb', line 12

def delete
  @api.delete_bucket(@name)
end

#nameObject



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