Class: CarrierWave::Storage::TT
- Inherits:
-
Abstract
- Object
- Abstract
- CarrierWave::Storage::TT
- Defined in:
- lib/carrierwave/storage/tt.rb
Defined Under Namespace
Classes: Connection, File
Instance Method Summary collapse
-
#retrieve!(identifier) ⇒ Object
Do something to retrieve the file.
-
#store!(file) ⇒ Object
Store the file on TokyoTyrant.
Instance Method Details
#retrieve!(identifier) ⇒ Object
Do something to retrieve the file
- identifier (String)
-
uniquely identifies the file
Returns
- CarrierWave::Storage::TT::File
-
the stored file
187 188 189 |
# File 'lib/carrierwave/storage/tt.rb', line 187 def retrieve!(identifier) CarrierWave::Storage::TT::File.new(uploader, self, uploader.store_path(identifier)) end |
#store!(file) ⇒ Object
Store the file on TokyoTyrant
Parameters
- file (CarrierWave::SanitizedFile)
-
the file to store
Returns
- CarrierWave::Storage::TT::File
-
the stored file
170 171 172 173 174 175 |
# File 'lib/carrierwave/storage/tt.rb', line 170 def store!(file) = {'Content-Type' => file.content_type} f = CarrierWave::Storage::TT::File.new(uploader, self, uploader.store_path) f.store(file.read,) f end |