Module: Bkblz::Task::TaskHelpers

Included in:
BaseTask
Defined in:
lib/bkblz/task/task_helpers.rb

Instance Method Summary collapse

Instance Method Details

#find_bucket_by_name(session, bucket_name) ⇒ Object

Raises:



8
9
10
11
12
13
14
15
# File 'lib/bkblz/task/task_helpers.rb', line 8

def find_bucket_by_name(session, bucket_name)
  buckets = session.send(Bkblz::V1::ListBucketsRequest.new).buckets
  bucket = buckets.find do |bucket|
    bucket.bucket_name == bucket_name
  end
  raise MissingBucketError, bucket_name unless bucket
  bucket
end