Class: Inverter::Tags

Inherits:
Object
  • Object
show all
Defined in:
lib/inverter/tags.rb

Class Method Summary collapse

Class Method Details

.update_html(html) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/inverter/tags.rb', line 3

def self.update_html(html)
  tags = parse_tags(html)

  tags.each do |tag, partials|
    tag_name = partials[0]
    params   = partials[1]

    if helper_exists?(tag_name)
      helper_result = call_helper(tag_name, params)
      html.gsub!(tag, helper_result)
    end
  end

  return html
end