class Dragonfly::DataStorage::RemoteDataStore

class Forbidden < StandardError; end

Public Instance Methods

destroy(uid) click to toggle source
# File lib/dragonfly/data_storage/remote_data_store.rb, line 31
def destroy(uid)
  raise "Sorry friend, this datastore is read-only."
end
retrieve(uid) click to toggle source
# File lib/dragonfly/data_storage/remote_data_store.rb, line 16
def retrieve(uid)
  response = HTTParty.get URI::join(url_host.to_s, uid).to_s, :timeout => 3
  unless response.ok?
    #raise Forbidden if response.code == 403
    raise DataNotFound
  end
  
  content = response.body
  extra_data = {}
  [
    content,            # either a File, String or Tempfile
    extra_data          # Hash with optional keys :meta, :name, :format
  ]
end
store(temp_object, opts={}) click to toggle source
# File lib/dragonfly/data_storage/remote_data_store.rb, line 12
def store(temp_object, opts={})
  raise "Sorry friend, this datastore is read-only."
end