You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
481 B

  1. # frozen_string_literal: true
  2. class ActivityPub::EmojiSerializer < ActivityPub::Serializer
  3. include RoutingHelper
  4. context_extensions :emoji
  5. attributes :id, :type, :name, :updated
  6. has_one :icon, serializer: ActivityPub::ImageSerializer
  7. def id
  8. ActivityPub::TagManager.instance.uri_for(object)
  9. end
  10. def type
  11. 'Emoji'
  12. end
  13. def icon
  14. object.image
  15. end
  16. def updated
  17. object.updated_at.iso8601
  18. end
  19. def name
  20. ":#{object.shortcode}:"
  21. end
  22. end