Class: Adhoq::Storage::FogStorage
- Inherits:
-
Object
- Object
- Adhoq::Storage::FogStorage
- Defined in:
- lib/adhoq/storage/fog_storage.rb
Instance Method Summary collapse
- #direct_download? ⇒ Boolean
- #get(identifier) ⇒ Object
- #get_raw(identifier) ⇒ Object
- #store(suffix = nil, seed = Time.now, &block) ⇒ Object
Instance Method Details
#direct_download? ⇒ Boolean
13 14 15 |
# File 'lib/adhoq/storage/fog_storage.rb', line 13 def direct_download? false end |
#get(identifier) ⇒ Object
17 18 19 |
# File 'lib/adhoq/storage/fog_storage.rb', line 17 def get(identifier) get_raw(identifier).body end |
#get_raw(identifier) ⇒ Object
21 22 23 |
# File 'lib/adhoq/storage/fog_storage.rb', line 21 def get_raw(identifier) directory.files.head(identifier) end |
#store(suffix = nil, seed = Time.now, &block) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/adhoq/storage/fog_storage.rb', line 4 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 |