Class: Cloudinary::CarrierWave::PreloadedCloudinaryFile

Inherits:
PreloadedFile show all
Defined in:
lib/cloudinary/carrier_wave/preloaded.rb

Constant Summary

Constants inherited from PreloadedFile

PreloadedFile::PRELOADED_CLOUDINARY_PATH

Instance Attribute Summary

Attributes inherited from PreloadedFile

#filename, #format, #public_id, #resource_type, #signature, #type, #version

Instance Method Summary collapse

Methods inherited from PreloadedFile

#identifier, split_format, #to_s, #valid?

Constructor Details

#initialize(file_info) ⇒ PreloadedCloudinaryFile

Returns a new instance of PreloadedCloudinaryFile.



43
44
45
46
47
48
# File 'lib/cloudinary/carrier_wave/preloaded.rb', line 43

def initialize(file_info)
  super
  if !valid?
    raise CarrierWave::IntegrityError, I18n.translate(:"errors.messages.cloudinary_signature_error", :public_id=>public_id, :default=>"Invalid signature for #{public_id}")
  end
end

Instance Method Details

#deleteObject



50
51
52
# File 'lib/cloudinary/carrier_wave/preloaded.rb', line 50

def delete
  # Do nothing. This is a virtual file.
end

#original_filenameObject



54
55
56
# File 'lib/cloudinary/carrier_wave/preloaded.rb', line 54

def original_filename
  self.filename
end