Methods

Class/Module Index [+]

Quicksearch

Fog::Storage::Google::Directories

Public Instance Methods

all() click to toggle source
# File lib/fog/google/models/storage/directories.rb, line 12
def all
 data = service.get_service.body['Buckets']
 load(data)
end
get(key, options = {}) click to toggle source
# File lib/fog/google/models/storage/directories.rb, line 17
def get(key, options = {})
  remap_attributes(options, {
    :delimiter  => 'delimiter',
    :marker     => 'marker',
    :max_keys   => 'max-keys',
    :prefix     => 'prefix'
  })
  data = service.get_bucket(key, options).body
  directory = new(:key => data['Name'])
  options = {}
  for k, v in data
    if ['CommonPrefixes', 'Delimiter', 'IsTruncated', 'Marker', 'MaxKeys', 'Prefix'].include?(k)
      options[k] = v
    end
  end
  directory.files.merge_attributes(options)
  directory.files.load(data['Contents'])
  directory
rescue Excon::Errors::NotFound
  nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.