Sha256: 7275ec40ebffcfc6208479bd47f91e17728efa3ee01993b31f600fac4b4bfe31
Contents?: true
Size: 605 Bytes
Versions: 2
Compression:
Stored size: 605 Bytes
Contents
module BootstrapEmail module Component class Align < Base def build ['left', 'center', 'right'].each do |type| full_type = "align-#{type}" each_node(".#{full_type}") do |node| align_helper(node, full_type, type) end end end def align_helper(node, full_type, type) unless table?(node) || td?(node) node['class'] = node['class'].sub(full_type, '') node = node.replace(template('table', classes: full_type, contents: node.to_html))[0] end node['align'] = type end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bootstrap-email-1.0.0.alpha2.1 | lib/bootstrap-email/components/align.rb |
bootstrap-email-1.0.0.alpha2 | lib/bootstrap-email/components/align.rb |