Class: Fog::Backblaze::Storage::Directories

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/backblaze/storage/models/directories.rb

Instance Method Summary collapse

Instance Method Details

#allObject


4
5
6
7
# File 'lib/fog/backblaze/storage/models/directories.rb', line 4

def all
  data = service.list_buckets
  load(data.body['buckets'])
end

#get(name) ⇒ Object


9
10
11
12
13
# File 'lib/fog/backblaze/storage/models/directories.rb', line 9

def get(name)
  list_response = service.list_buckets
  bucket = list_response.json['buckets'].detect {|bucket| bucket['bucketName'] == name }
  return new(bucket) if bucket
end