Class: Dag::BucketCollection

Inherits:
Model
  • Object
show all
Includes:
Enumerable
Defined in:
lib/dag/client/model/bucket_collection.rb

Instance Attribute Summary

Attributes inherited from Model

#api

Instance Method Summary collapse

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from Dag::Model

Instance Method Details

#[](bucket_name) ⇒ Bucket

Examples:


bucket = client.buckets[:mybucket],
bucket = client.buckets['mybucket'],

Parameters:

  • bucket_name (String)

Returns:



17
18
19
# File 'lib/dag/client/model/bucket_collection.rb', line 17

def [] bucket_name
  bucket_named(bucket_name)
end

#create(bucket_name) ⇒ Object



5
6
7
8
# File 'lib/dag/client/model/bucket_collection.rb', line 5

def create(bucket_name)
  @api.create_bucket(bucket_name)
  bucket_named(bucket_name)
end

#eachObject



21
22
23
24
25
26
# File 'lib/dag/client/model/bucket_collection.rb', line 21

def each
  buckets = @api.buckets.buckets
  buckets.each do |bucket|
    yield bucket_named(bucket)
  end
end