tag_stream_presenter.rb 614 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
class TagStreamPresenter < BasePresenter
  def title
    @presentable.display_tag_name
  end

  def metas_attributes
    {
      keywords:       {name:     "keywords",       content: tag_name},
      description:    {name:     "description",    content: description},
      og_url:         {property: "og:url",         content: url},
      og_title:       {property: "og:title",       content: title},
      og_description: {property: "og:description", content: description}
    }
  end

  private

  def description
    I18n.t("streams.tags.title", tags: tag_name)
  end

  def url
    tag_url tag_name
  end
end