Class: CarrierWave::Storage::Roz

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

Defined Under Namespace

Classes: File

Instance Method Summary collapse

Instance Method Details

#identifierObject



7
8
9
10
11
12
# File 'lib/carrierwave/storage/roz.rb', line 7

def identifier
  return nil unless uploader.filename

  full_filename = [uploader.version_name, uploader.filename].compact.join('_')
  ::File.join(*[uploader.access_id, uploader.store_dir, full_filename].map(&:to_s))
end

#retrieve!(identifier) ⇒ Object



20
21
22
# File 'lib/carrierwave/storage/roz.rb', line 20

def retrieve!(identifier)
  CarrierWave::Storage::Roz::File.new(uploader, identifier)
end

#store!(file) ⇒ Object



14
15
16
17
18
# File 'lib/carrierwave/storage/roz.rb', line 14

def store!(file)
  f = CarrierWave::Storage::Roz::File.new(uploader, identifier)
  f.store(file)
  f
end