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.

23 lines
383 B

  1. # frozen_string_literal: true
  2. class ActivityPub::HashtagSerializer < ActivityPub::Serializer
  3. include RoutingHelper
  4. attributes :type, :href, :name
  5. def type
  6. 'Hashtag'
  7. end
  8. def name
  9. "##{object.name}"
  10. end
  11. def href
  12. if object.class.name == 'FeaturedTag'
  13. short_account_tag_url(object.account, object.tag)
  14. else
  15. tag_url(object)
  16. end
  17. end
  18. end