class Roadie::Inliner::StyleMap
@api private StyleMap is a map between a DOM element and {StyleAttributeBuilder}. Basically, it's an accumulator for properties, scoped on specific elements.
Public Class Methods
new()
click to toggle source
# File lib/roadie/inliner.rb, line 113 def initialize @map = Hash.new { |hash, key| hash[key] = StyleAttributeBuilder.new } end
Public Instance Methods
add(elements, new_properties)
click to toggle source
# File lib/roadie/inliner.rb, line 119 def add(elements, new_properties) Array(elements).each do |element| new_properties.each do |property| @map[element] << property end end end
each_element(&block)
click to toggle source
# File lib/roadie/inliner.rb, line 127 def each_element(&block) @map.each_pair(&block) end