Class: Alchemy::PictureThumb::Uid
- Inherits:
-
Object
- Object
- Alchemy::PictureThumb::Uid
- Defined in:
- app/models/alchemy/picture_thumb/uid.rb
Class Method Summary collapse
-
.call(signature, variant) ⇒ String
Returns a image variant uid for storage.
Class Method Details
.call(signature, variant) ⇒ String
Returns a image variant uid for storage
12 13 14 15 16 17 18 19 |
# File 'app/models/alchemy/picture_thumb/uid.rb', line 12 def self.call(signature, variant) picture = variant.picture filename = variant.image_file_name || "image" name = File.basename(filename, ".*").gsub(/[^\w.]+/, "_") ext = variant.render_format "pictures/#{picture.id}/#{signature}/#{name}.#{ext}" end |