The code powering m.abunchtell.com https://m.abunchtell.com
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

30 lignes
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