Class: PageMeta::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/page_meta/tag.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content.



9
10
11
# File 'lib/page_meta/tag.rb', line 9

def content
  @content
end

#tagObject (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

#helpersObject



20
21
22
# File 'lib/page_meta/tag.rb', line 20

def helpers
  ActionController::Base.helpers
end

#renderObject



16
17
18
# File 'lib/page_meta/tag.rb', line 16

def render
  helpers.(tag, content) unless content.blank?
end