Class: ActivityPub::ImageSerializer

Inherits:
BaseSerializer
  • Object
show all
Defined in:
app/serializers/activitypub/image_serializer.rb

Constant Summary

Constants inherited from BaseSerializer

BaseSerializer::CONTEXT

Instance Attribute Summary

Attributes inherited from BaseSerializer

#options

Instance Method Summary collapse

Methods inherited from BaseSerializer

#as_json, #initialize, #to_json

Constructor Details

This class inherits a constructor from ActivityPub::BaseSerializer

Instance Method Details

#dataObject



3
4
5
6
7
8
9
# File 'app/serializers/activitypub/image_serializer.rb', line 3

def data
  {
    type: 'Image',
    url: image_url(object[:size_400].url, host: ActionController::Base.asset_host),
    media_type: object[object.keys.first].mime_type
  }
end