2018-04-25 00:10:02 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-05-10 07:50:54 +00:00
|
|
|
class RSS::TagSerializer < RSS::Serializer
|
2018-04-25 00:10:02 +00:00
|
|
|
include ActionView::Helpers::NumberHelper
|
|
|
|
include ActionView::Helpers::SanitizeHelper
|
|
|
|
include RoutingHelper
|
|
|
|
|
|
|
|
def render(tag, statuses)
|
|
|
|
builder = RSSBuilder.new
|
|
|
|
|
|
|
|
builder.title("##{tag.name}")
|
|
|
|
.description(strip_tags(I18n.t('about.about_hashtag_html', hashtag: tag.name)))
|
|
|
|
.link(tag_url(tag))
|
2019-03-15 14:05:31 +00:00
|
|
|
.logo(full_pack_url('media/images/logo.svg'))
|
2018-04-25 00:10:02 +00:00
|
|
|
.accent_color('2b90d9')
|
|
|
|
|
2020-05-10 07:50:54 +00:00
|
|
|
render_statuses(builder, statuses)
|
2018-04-25 00:10:02 +00:00
|
|
|
|
|
|
|
builder.to_xml
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.render(tag, statuses)
|
|
|
|
new.render(tag, statuses)
|
|
|
|
end
|
|
|
|
end
|