preview_card_serializer.rb 408 B

1234567891011121314
  1. # frozen_string_literal: true
  2. class REST::PreviewCardSerializer < ActiveModel::Serializer
  3. include RoutingHelper
  4. attributes :url, :title, :description, :type,
  5. :author_name, :author_url, :provider_name,
  6. :provider_url, :html, :width, :height,
  7. :image, :embed_url, :blurhash
  8. def image
  9. object.image? ? full_asset_url(object.image.url(:original)) : nil
  10. end
  11. end