Sha256: 59ab038e08b392018cf83f4af8f1f740f898a9b892b19a7f385cc9c02a9ddf57

Contents?: true

Size: 540 Bytes

Versions: 13

Compression:

Stored size: 540 Bytes

Contents

module Adhoq
  module Storage
    class FogStorage
      def store(suffix = nil, seed = Time.now, &block)
        Adhoq::Storage.with_new_identifier(suffix, seed) do |identifier|
          io = yield
          io.rewind

          directory.files.create(key: identifier, body: io, public: false)
        end
      end

      def direct_download?
        false
      end

      def get(identifier)
        get_raw(identifier).body
      end

      def get_raw(identifier)
        directory.files.head(identifier)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
adhoq-1.0.2 lib/adhoq/storage/fog_storage.rb
adhoq-1.0.1 lib/adhoq/storage/fog_storage.rb
adhoq-1.0.0 lib/adhoq/storage/fog_storage.rb
adhoq-0.5.0 lib/adhoq/storage/fog_storage.rb
adhoq-0.5.0.beta1 lib/adhoq/storage/fog_storage.rb
adhoq-0.4.0 lib/adhoq/storage/fog_storage.rb
adhoq-0.3.0 lib/adhoq/storage/fog_storage.rb
adhoq-0.2.0 lib/adhoq/storage/fog_storage.rb
adhoq-0.1.2 lib/adhoq/storage/fog_storage.rb
adhoq-0.1.1 lib/adhoq/storage/fog_storage.rb
adhoq-0.1.0 lib/adhoq/storage/fog_storage.rb
adhoq-0.0.7 lib/adhoq/storage/fog_storage.rb
adhoq-0.0.6 lib/adhoq/storage/fog_storage.rb