Class: CarrierWave::Storage::TT

Inherits:
Abstract
  • Object
show all
Defined in:
lib/carrierwave/storage/tt.rb

Defined Under Namespace

Classes: Connection, File

Instance Method Summary collapse

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

Parameters:

  • identifier (String)

    uniquely identifies the 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)
  cloud_files_options = {'Content-Type' => file.content_type}
  f = CarrierWave::Storage::TT::File.new(uploader, self, uploader.store_path)
  f.store(file.read,cloud_files_options)
  f
end