mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-16 13:14:17 -05:00
20 lines
296 B
Ruby
20 lines
296 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class ActivityPub::ImageSerializer < ActiveModel::Serializer
|
||
|
include RoutingHelper
|
||
|
|
||
|
attributes :type, :media_type, :url
|
||
|
|
||
|
def type
|
||
|
'Image'
|
||
|
end
|
||
|
|
||
|
def url
|
||
|
full_asset_url(object.url(:original))
|
||
|
end
|
||
|
|
||
|
def media_type
|
||
|
object.content_type
|
||
|
end
|
||
|
end
|