Class: BootstrapEmail::Converter::Grid

Inherits:
Base
  • Object
show all
Defined in:
lib/bootstrap-email/converters/grid.rb

Instance Attribute Summary

Attributes inherited from Base

#doc

Instance Method Summary collapse

Methods inherited from Base

build, #initialize

Constructor Details

This class inherits a constructor from BootstrapEmail::Converter::Base

Instance Method Details

#buildObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/bootstrap-email/converters/grid.rb', line 4

def build
  each_node('.row') do |node|
    if node.at("./*[contains(@class, 'col-lg-')]")
      add_class(node, 'row-responsive')
    end
    node.replace(template('div', classes: node['class'], contents: template('table-to-tr', contents: node.inner_html)))
  end
  each_node('*[class*=col]') do |node|
    node.replace(template('td', classes: node['class'], contents: node.inner_html))
  end
end