Methods

Class/Module Index [+]

Quicksearch

Fog::Storage::HP::SharedFiles

Public Instance Methods

all() click to toggle source
# File lib/fog/hp/models/storage/shared_files.rb, line 14
def all
  requires :shared_directory
  parent = shared_directory.collection.get(shared_directory.url)
  if parent
    load(parent.files.map {|file| file.attributes})
  else
    nil
  end
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
  nil
end
get(key, &block) click to toggle source
# File lib/fog/hp/models/storage/shared_files.rb, line 27
def get(key, &block)
  requires :shared_directory
  shared_object_url = "#{shared_directory.url}/#{key}"
  data = service.get_shared_object(shared_object_url, &block)
  file_data = data.headers.merge({
    :body => data.body,
    :key  => key
  })
  new(file_data)
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
  nil
end
head(key) click to toggle source
# File lib/fog/hp/models/storage/shared_files.rb, line 41
def head(key)
  requires :shared_directory
  shared_object_url = "#{shared_directory.url}/#{key}"
  data = service.head_shared_object(shared_object_url)
  file_data = data.headers.merge({
    :body => '',
    :key => key
  })
  new(file_data)
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
  nil
end
new(attributes = {}) click to toggle source
# File lib/fog/hp/models/storage/shared_files.rb, line 55
def new(attributes = {})
  requires :shared_directory
  super({ :shared_directory => shared_directory }.merge!(attributes))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.