Class: BootstrapEmail::Converter::Spacing
- Defined in:
- lib/bootstrap-email/converters/spacing.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from BootstrapEmail::Converter::Base
Instance Method Details
#build ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/bootstrap-email/converters/spacing.rb', line 6 def build each_node('*[class*=space-y-]') do |node| spacer = node['class'].scan(/space-y-((lg-)?\d+)/)[0][0] # get all direct children except the first node.xpath('./*[position() < last()] | ./tbody/tr/td/*[position() < last()]').each do |child| next if margin_bottom?(child) add_class(child, "mb-#{spacer}") end end end |