Sha256: f140e1120a3ede9c92661a1a0bbf746efbd86598c1e19952aafcceadd3af8b98
Contents?: true
Size: 683 Bytes
Versions: 19
Compression:
Stored size: 683 Bytes
Contents
module Spina::Api class ImageSerializer < BaseSerializer set_type :image attributes :id attribute :original_url do |image, params| params[:view_context].main_app.url_for(image.file) end attribute :thumbnail_url do |image, params| params[:view_context].main_app.url_for(image.variant(resize_to_fill: Spina.config.thumbnail_image_size)) end attribute :embedded_image_size_url do |image, params| resize_key = Spina.config.embedded_image_size.is_a?(Array) ? :resize_to_limit : :resize params[:view_context].main_app.url_for(image.variant(Hash[resize_key, Spina.config.embedded_image_size])) end end end
Version data entries
19 entries across 19 versions & 1 rubygems