Class: PageMeta::OpenTag

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag, attrs) ⇒ OpenTag

Returns a new instance of OpenTag.


11
12
13
14
# File 'lib/page_meta/open_tag.rb', line 11

def initialize(tag, attrs)
  @tag = tag
  @attrs = attrs
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.


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

def attrs
  @attrs
end

#tagObject (readonly)

Returns the value of attribute tag.


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

def tag
  @tag
end

Class Method Details

.build(tag, attrs) ⇒ Object


5
6
7
# File 'lib/page_meta/open_tag.rb', line 5

def self.build(tag, attrs)
  new(tag, attrs)
end

Instance Method Details

#helpersObject


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

def helpers
  ActionController::Base.helpers
end

#renderObject


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

def render
  helpers.tag(tag, attrs)
end