闭社主体 forked from https://github.com/tootsuite/mastodon
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.

29 lines
452 B

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