Class: Caseblocks::BucketGroup
- Inherits:
-
Object
- Object
- Caseblocks::BucketGroup
- Defined in:
- lib/caseblocks/bucket_group.rb
Overview
Class Method Summary collapse
Instance Method Summary collapse
- #buckets ⇒ Object
-
#initialize(bucket_group_data, client) ⇒ BucketGroup
constructor
A new instance of BucketGroup.
- #name ⇒ Object
Constructor Details
#initialize(bucket_group_data, client) ⇒ BucketGroup
Returns a new instance of BucketGroup.
14 15 16 17 |
# File 'lib/caseblocks/bucket_group.rb', line 14 def initialize(bucket_group_data, client) @client = client @bucket_group_data = bucket_group_data end |
Class Method Details
.all(client) ⇒ Object
4 5 6 7 |
# File 'lib/caseblocks/bucket_group.rb', line 4 def self.all(client) res = client.new.request("/case_blocks/bucket_groups.json") res["bucket_groups"].map{|bg| Caseblocks::BucketGroup.new(bg, client)} end |
Instance Method Details
#buckets ⇒ Object
23 24 25 26 |
# File 'lib/caseblocks/bucket_group.rb', line 23 def buckets query = @bucket_group_data["buckets"].map{|id| "ids%5B%5D=#{id}" }.join("&") @buckets ||= @client.request("/case_blocks/buckets.json?#{query}")["buckets"].map{|bucket| Caseblocks::Bucket.new(bucket, client) } end |
#name ⇒ Object
19 20 21 |
# File 'lib/caseblocks/bucket_group.rb', line 19 def name @bucket_group_data["name"] end |