Class: Seorel::Helper::Twitter
- Inherits:
-
Base
- Object
- Base
- Seorel::Helper::Twitter
show all
- Defined in:
- lib/seorel/helper/twitter.rb
Instance Attribute Summary
Attributes inherited from Base
#params, #request
Instance Method Summary
collapse
Methods inherited from Base
#helpers, #image_url, #initialize, #locale, #render
Instance Method Details
#all ⇒ Object
31
32
33
34
35
36
37
38
|
# File 'lib/seorel/helper/twitter.rb', line 31
def all
([
title_tag,
description_tag,
image_tag,
url_tag
] + custom_tags).compact
end
|
25
26
27
28
29
|
# File 'lib/seorel/helper/twitter.rb', line 25
def custom_tags
params..reduce([]) do |data, (key, value)|
data.push custum_tag(key, value)
end
end
|
#description_tag ⇒ Object
13
14
15
|
# File 'lib/seorel/helper/twitter.rb', line 13
def description_tag
h.tag :meta, name: 'twitter:description', content: description
end
|
#image_tag ⇒ Object
17
18
19
|
# 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 ⇒ Object
9
10
11
|
# File 'lib/seorel/helper/twitter.rb', line 9
def title_tag
h.tag :meta, name: 'twitter:title', content: title
end
|
#url_tag ⇒ Object
21
22
23
|
# File 'lib/seorel/helper/twitter.rb', line 21
def url_tag
h.tag(:meta, name: 'twitter:url', content: request.url)
end
|