Class: Alchemy::EssencePicture Deprecated

Inherits:
BaseRecord
  • Object
show all
Includes:
PictureThumbnails
Defined in:
app/models/alchemy/essence_picture.rb

Overview

Deprecated.

Instance Method Summary collapse

Methods included from PictureThumbnails

#allow_image_cropping?, #image_cropper_settings, #picture_url, #picture_url_options, #thumbnail_url, #thumbnail_url_options

Instance Method Details

#preview_text(max = 30) ⇒ String

The name of the picture used as preview text in element editor views.

Parameters:

  • max (Integer) (defaults to: 30)

    The maximum length of the text returned.

Returns:

  • (String)


46
47
48
49
50
# File 'app/models/alchemy/essence_picture.rb', line 46

def preview_text(max = 30)
  return "" if picture.nil?

  picture.name.to_s[0..max - 1]
end

#serialized_ingredientString

Returns a serialized ingredient value for json api

Returns:

  • (String)


55
56
57
# File 'app/models/alchemy/essence_picture.rb', line 55

def serialized_ingredient
  picture_url(content.settings)
end