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.

25 lines
635 B

  1. # frozen_string_literal: true
  2. class RSS::TagSerializer < RSS::Serializer
  3. include ActionView::Helpers::NumberHelper
  4. include ActionView::Helpers::SanitizeHelper
  5. include RoutingHelper
  6. def render(tag, statuses)
  7. builder = RSSBuilder.new
  8. builder.title("##{tag.name}")
  9. .description(strip_tags(I18n.t('about.about_hashtag_html', hashtag: tag.name)))
  10. .link(tag_url(tag))
  11. .logo(full_pack_url('media/images/logo.svg'))
  12. .accent_color('2b90d9')
  13. render_statuses(builder, statuses)
  14. builder.to_xml
  15. end
  16. def self.render(tag, statuses)
  17. new.render(tag, statuses)
  18. end
  19. end