Class: PageMeta::Tag
- Inherits:
-
Object
- Object
- PageMeta::Tag
- Defined in:
- lib/page_meta/tag.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Class Method Summary collapse
Instance Method Summary collapse
- #helpers ⇒ Object
-
#initialize(tag, content) ⇒ Tag
constructor
A new instance of Tag.
- #render ⇒ Object
Constructor Details
#initialize(tag, content) ⇒ Tag
Returns a new instance of Tag.
11 12 13 14 |
# File 'lib/page_meta/tag.rb', line 11 def initialize(tag, content) @tag = tag @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
9 10 11 |
# File 'lib/page_meta/tag.rb', line 9 def content @content end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
9 10 11 |
# File 'lib/page_meta/tag.rb', line 9 def tag @tag end |
Class Method Details
.build(tag, content) ⇒ Object
5 6 7 |
# File 'lib/page_meta/tag.rb', line 5 def self.build(tag, content) new(tag, content) end |
Instance Method Details
#helpers ⇒ Object
20 21 22 |
# File 'lib/page_meta/tag.rb', line 20 def helpers ActionController::Base.helpers end |
#render ⇒ Object
16 17 18 |
# File 'lib/page_meta/tag.rb', line 16 def render helpers.content_tag(tag, content) unless content.blank? end |