class Seorel::Helper::Twitter

Public Instance Methods

all() click to toggle source
# File lib/seorel/helper/twitter.rb, line 31
def all
  ([
    title_tag,
    description_tag,
    image_tag,
    url_tag
  ] + custom_tags).compact
end
custom_tags() click to toggle source
# File lib/seorel/helper/twitter.rb, line 25
def custom_tags
  params.twitter_extras.reduce([]) do |data, (key, value)|
    data.push custum_tag(key, value)
  end
end
description_tag() click to toggle source
# File lib/seorel/helper/twitter.rb, line 13
def description_tag
  h.tag :meta, name: 'twitter:description', content: description
end
image_tag() click to toggle source
# File lib/seorel/helper/twitter.rb, line 17
def image_tag
  h.tag(:meta, name: 'twitter:image', content: image_url) if image
end
title_tag() click to toggle source
# File lib/seorel/helper/twitter.rb, line 9
def title_tag
  h.tag :meta, name: 'twitter:title', content: title
end
url_tag() click to toggle source
# File lib/seorel/helper/twitter.rb, line 21
def url_tag
  h.tag(:meta, name: 'twitter:url', content: request.url)
end

Protected Instance Methods

custum_tag(key, value) click to toggle source
# File lib/seorel/helper/twitter.rb, line 42
def custum_tag(key, value)
  h.tag(:meta, name: "twitter:#{key}", content: value)
end