Class: MetaTags::Renderer
- Inherits:
-
Object
- Object
- MetaTags::Renderer
- Defined in:
- lib/meta_tags-rails/renderer.rb
Overview
This class is used by MetaTags gems to render HTML meta tags into page.
Instance Attribute Summary collapse
-
#meta_tags ⇒ Object
readonly
Returns the value of attribute meta_tags.
-
#normalized_meta_tags ⇒ Object
readonly
Returns the value of attribute normalized_meta_tags.
Instance Method Summary collapse
-
#initialize(meta_tags) ⇒ Renderer
constructor
Initialized a new instance of Renderer.
-
#render(view) ⇒ Object
Renders meta tags on the page.
Constructor Details
#initialize(meta_tags) ⇒ Renderer
Initialized a new instance of Renderer.
10 11 12 13 |
# File 'lib/meta_tags-rails/renderer.rb', line 10 def initialize() @meta_tags = @normalized_meta_tags = {} end |
Instance Attribute Details
#meta_tags ⇒ Object (readonly)
Returns the value of attribute meta_tags.
4 5 6 |
# File 'lib/meta_tags-rails/renderer.rb', line 4 def @meta_tags end |
#normalized_meta_tags ⇒ Object (readonly)
Returns the value of attribute normalized_meta_tags.
4 5 6 |
# File 'lib/meta_tags-rails/renderer.rb', line 4 def @normalized_meta_tags end |
Instance Method Details
#render(view) ⇒ Object
Renders meta tags on the page.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/meta_tags-rails/renderer.rb', line 18 def render(view) = [] render_charset() render_title() render_icon() render_with_normalization(, :description) render_with_normalization(, :keywords) render_refresh() render_noindex() render_alternate() render_open_search() render_links() render_hash(, :og, name_key: :property) render_hash(, :fb, name_key: :property) render_hash(, :al, name_key: :property) render_hash(, :article, name_key: :property) render_hashes() render_custom() .compact.map { |tag| tag.render(view) }.join("\n").html_safe end |