Class: MetaTags::Tag
- Inherits:
-
Object
- Object
- MetaTags::Tag
- Defined in:
- lib/meta_tags-rails/tag.rb
Overview
Represents an HTML meta tag with no content (<tag />).
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, attributes = {}) ⇒ Tag
constructor
Initializes a new instance of Tag class.
-
#render(view) ⇒ String
Render tag into a Rails view.
Constructor Details
#initialize(name, attributes = {}) ⇒ Tag
Initializes a new instance of Tag class.
11 12 13 14 |
# File 'lib/meta_tags-rails/tag.rb', line 11 def initialize(name, attributes = {}) @name = name @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/meta_tags-rails/tag.rb', line 4 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/meta_tags-rails/tag.rb', line 4 def name @name end |
Instance Method Details
#render(view) ⇒ String
Render tag into a Rails view.
21 22 23 |
# File 'lib/meta_tags-rails/tag.rb', line 21 def render(view) view.tag(name, attributes) end |