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.
26 lines
420 B
26 lines
420 B
# frozen_string_literal: true
|
|
|
|
class ActivityPub::HashtagSerializer < ActivityPub::Serializer
|
|
context_extensions :hashtag
|
|
|
|
include RoutingHelper
|
|
|
|
attributes :type, :href, :name
|
|
|
|
def type
|
|
'Hashtag'
|
|
end
|
|
|
|
def name
|
|
"##{object.display_name}"
|
|
end
|
|
|
|
def href
|
|
if object.instance_of?(FeaturedTag)
|
|
short_account_tag_url(object.account, object.tag)
|
|
else
|
|
tag_url(object)
|
|
end
|
|
end
|
|
end
|