Class: Cloudinary::CarrierWave::StoredFile
- Inherits:
-
PreloadedFile
- Object
- PreloadedFile
- Cloudinary::CarrierWave::StoredFile
- 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
- #delete ⇒ Object
-
#initialize(file_info) ⇒ StoredFile
constructor
A new instance of StoredFile.
- #original_filename ⇒ Object
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from PreloadedFile
Constructor Details
#initialize(file_info) ⇒ StoredFile
Returns a new instance of StoredFile.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/cloudinary/carrier_wave/preloaded.rb', line 60 def initialize(file_info) if file_info.match(STORED_CLOUDINARY_PATH) @resource_type, @type, @version, @filename = file_info.scan(STORED_CLOUDINARY_PATH).first elsif file_info.match(SHORT_STORED_CLOUDINARY_PATH) @version, @filename = file_info.scan(SHORT_STORED_CLOUDINARY_PATH).first else raise(ArgumentError, "File #{file_info} is illegal") end @public_id, @format = Cloudinary::PreloadedFile.split_format(@filename) end |
Instance Method Details
#delete ⇒ Object
75 76 77 |
# File 'lib/cloudinary/carrier_wave/preloaded.rb', line 75 def delete # Do nothing. This is a virtual file. end |
#original_filename ⇒ Object
79 80 81 |
# File 'lib/cloudinary/carrier_wave/preloaded.rb', line 79 def original_filename self.filename end |
#to_s ⇒ Object
83 84 85 |
# File 'lib/cloudinary/carrier_wave/preloaded.rb', line 83 def to_s identifier end |
#valid? ⇒ Boolean
71 72 73 |
# File 'lib/cloudinary/carrier_wave/preloaded.rb', line 71 def valid? true end |