Class: Aws::S3::Resource
- Inherits:
-
Object
- Object
- Aws::S3::Resource
- Defined in:
- lib/aws-sdk-s3/resource.rb
Actions collapse
Associations collapse
Instance Method Summary collapse
- #client ⇒ Client
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
Instance Method Details
#bucket(name) ⇒ Bucket
72 73 74 75 76 77 |
# File 'lib/aws-sdk-s3/resource.rb', line 72 def bucket(name) Bucket.new( name: name, client: @client ) end |
#buckets(options = {}) ⇒ Bucket::Collection
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/aws-sdk-s3/resource.rb', line 84 def buckets( = {}) batches = Enumerator.new do |y| batch = [] resp = @client.list_buckets() resp.data.buckets.each do |b| batch << Bucket.new( name: b.name, data: b, client: @client ) end y.yield(batch) end Bucket::Collection.new(batches) end |