Class: Alchemy::PictureThumb::FileStore

Inherits:
Object
  • Object
show all
Defined in:
app/models/alchemy/picture_thumb/file_store.rb

Overview

Stores the render result of a Alchemy::PictureVariant in the configured Dragonfly datastore (Default: Dragonfly::FileDataStore)

Class Method Summary collapse

Class Method Details

.call(variant, uid) ⇒ Object

Parameters:

  • variant (Alchemy::PictureVariant)

    the to be rendered image

  • uid (String)

    The Unique Image Identifier the image is stored at



14
15
16
17
18
19
# File 'app/models/alchemy/picture_thumb/file_store.rb', line 14

def call(variant, uid)
  # process the image
  image = variant.image
  # store the processed image
  image.to_file(server_path(uid)).close
end