Parent

Class/Module Index [+]

Quicksearch

Fog::Storage::HP::SharedFile

Public Instance Methods

body() click to toggle source
# File lib/fog/hp/models/storage/shared_file.rb, line 21
def body
  attributes[:body] ||= if last_modified
    collection.get(identity).body
  else
    ''
  end
end
body=(new_body) click to toggle source
# File lib/fog/hp/models/storage/shared_file.rb, line 29
def body=(new_body)
  attributes[:body] = new_body
end
destroy() click to toggle source
# File lib/fog/hp/models/storage/shared_file.rb, line 33
def destroy
  requires :shared_directory, :key
  service.delete_shared_object(self.url)
  true
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
  false
end
save(options = {}) click to toggle source
# File lib/fog/hp/models/storage/shared_file.rb, line 46
def save(options = {})
  requires :shared_directory, :key
  options['Content-Type'] = content_type if content_type
  data = service.put_shared_object(shared_directory.url, key, body, options)
  merge_attributes(data.headers)
  self.content_length = Fog::Storage.get_body_size(body)
  true
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
  false
end
shared_directory() click to toggle source
# File lib/fog/hp/models/storage/shared_file.rb, line 42
def shared_directory
  @shared_directory
end
url() click to toggle source
# File lib/fog/hp/models/storage/shared_file.rb, line 17
def url
  "#{self.collection.shared_directory.url}/#{key}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.