Class: BootstrapEmail::Converter::Stack
- Inherits:
-
Base
- Object
- Base
- BootstrapEmail::Converter::Stack
show all
- Defined in:
- lib/bootstrap-email/converters/stack.rb
Instance Attribute Summary
Attributes inherited from Base
#doc
Instance Method Summary
collapse
Methods inherited from Base
build, #initialize
Instance Method Details
#build ⇒ Object
6
7
8
9
|
# File 'lib/bootstrap-email/converters/stack.rb', line 6
def build
stack_row
stack_col
end
|
#stack_col ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/bootstrap-email/converters/stack.rb', line 21
def stack_col
each_node('.stack-col') do |node|
html = ''
node.xpath('./*').each do |child|
html += template('tr', classes: 'stack-cell', contents: child.to_html)
end
node.replace(template('table-to-tbody', classes: node['class'], contents: html))
end
end
|
#stack_row ⇒ Object
11
12
13
14
15
16
17
18
19
|
# File 'lib/bootstrap-email/converters/stack.rb', line 11
def stack_row
each_node('.stack-row') do |node|
html = ''
node.xpath('./*').each do |child|
html += template('td', classes: 'stack-cell', contents: child.to_html)
end
node.replace(template('table-to-tr', classes: node['class'], contents: html))
end
end
|