Class: MetaTags::Renderer
- Inherits:
-
Object
- Object
- MetaTags::Renderer
- Defined in:
- lib/meta_tags/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.
12 13 14 15 |
# File 'lib/meta_tags/renderer.rb', line 12 def initialize() @meta_tags = @normalized_meta_tags = {} end |
Instance Attribute Details
#meta_tags ⇒ Object (readonly)
Returns the value of attribute meta_tags.
6 7 8 |
# File 'lib/meta_tags/renderer.rb', line 6 def @meta_tags end |
#normalized_meta_tags ⇒ Object (readonly)
Returns the value of attribute normalized_meta_tags.
6 7 8 |
# File 'lib/meta_tags/renderer.rb', line 6 def @normalized_meta_tags end |
Instance Method Details
#render(view) ⇒ Object
Renders meta tags on the page.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/meta_tags/renderer.rb', line 20 def render(view) = [] render_charset() render_title() render_icon() render_with_normalization(, :description) render_with_normalization(, :keywords) render_refresh() render_canonical_link() render_noindex() render_alternate() render_open_search() render_links() render_hashes() render_custom() .tap(&:compact!).map! { |tag| tag.render(view) } view.safe_join , MetaTags.config.minify_output ? "" : "\n" end |