Class: CarrierWave::Storage::Riak
- Inherits:
-
Abstract
- Object
- Abstract
- CarrierWave::Storage::Riak
- Defined in:
- lib/carrierwave/storage/riak.rb
Overview
CarrierWave.configure do |config|
config.riak_host = "http://localhost
config.riak_port = 8098
end
Defined Under Namespace
Classes: Connection, File
Instance Method Summary collapse
- #identifier ⇒ Object
-
#retrieve!(key) ⇒ Object
Do something to retrieve the file.
-
#store!(file) ⇒ Object
Store the file on Riak.
Instance Method Details
#identifier ⇒ Object
233 234 235 |
# File 'lib/carrierwave/storage/riak.rb', line 233 def identifier uploader.key end |
#retrieve!(key) ⇒ Object
Do something to retrieve the file
- identifier (String)
-
uniquely identifies the file
Returns
- CarrierWave::Storage::Riak::File
-
the stored file
229 230 231 |
# File 'lib/carrierwave/storage/riak.rb', line 229 def retrieve!(key) CarrierWave::Storage::Riak::File.new(uploader, self, uploader.bucket, key) end |
#store!(file) ⇒ Object
Store the file on Riak
Parameters
- file (CarrierWave::SanitizedFile)
-
the file to store
Returns
- CarrierWave::Storage::Riak::File
-
the stored file
213 214 215 216 217 |
# File 'lib/carrierwave/storage/riak.rb', line 213 def store!(file) f = CarrierWave::Storage::Riak::File.new(uploader, self, uploader.bucket, uploader.key) f.store(file) f end |