lib/smithy/dragonfly/remote_data_store.rb in smithycms-0.0.3 vs lib/smithy/dragonfly/remote_data_store.rb in smithycms-0.4.0
- old
+ new
@@ -1,22 +1,16 @@
require 'httparty'
module Smithy
module Dragonfly
module DataStorage
class RemoteDataStore
- include ::Dragonfly::Configurable
-
- def store(temp_object, opts={})
+ def write(content, opts={})
# raise "Sorry friend, this datastore is read-only."
end
- def retrieve(uid)
+ def read(uid)
response = HTTParty.get uid, :timeout => 3
- unless response.ok?
- #raise Forbidden if response.code == 403
- raise DataNotFound
- end
-
+ raise DataNotFound unless response.ok?
content = response.body
extra_data = {}
[
content, # either a File, String or Tempfile
extra_data # Hash with optional keys :meta, :name, :format