Sha256: 6a21376538d98cb001d2e053e95e6743fa7d40a269efc8d45b75bd9a63ec140a
Contents?: true
Size: 710 Bytes
Versions: 13
Compression:
Stored size: 710 Bytes
Contents
require 'httparty' module Smithy module Dragonfly module DataStorage class RemoteDataStore def write(content, opts={}) # raise "Sorry friend, this datastore is read-only." end def read(uid) response = HTTParty.get uid, :timeout => 3 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 ] end def destroy(uid) raise "Sorry friend, this datastore is read-only." end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems