2019-07-02 08:10:25 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class REST::PreviewCardSerializer < ActiveModel::Serializer
|
|
|
|
include RoutingHelper
|
|
|
|
|
2020-10-29 23:46:54 +00:00
|
|
|
attributes :id, :url, :title, :description, :type,
|
2019-07-02 08:10:25 +01:00
|
|
|
:author_name, :author_url, :provider_name,
|
|
|
|
:provider_url, :html, :width, :height,
|
2020-11-03 03:46:02 +00:00
|
|
|
:image, :embed_url, :updated_at
|
2019-07-02 08:10:25 +01:00
|
|
|
|
|
|
|
def image
|
|
|
|
object.image? ? full_asset_url(object.image.url(:original)) : nil
|
|
|
|
end
|
|
|
|
end
|