class Haml::AttributeCompiler
def static_compile(static_hash, dynamic_hashes)
def static_compile(static_hash, dynamic_hashes) temple = [:html, :attrs] keys = [*static_hash.keys, *dynamic_hashes.map(&:keys).flatten].uniq.sort keys.each do |key| values = [[:static, static_hash[key]], *dynamic_hashes.map { |h| [:dynamic, h[key]] }] values.select! { |_, exp| exp != nil } case key when 'id' compile_id!(temple, key, values) when 'class' compile_class!(temple, key, values) when 'data', 'aria' compile_data!(temple, key, values) when *AttributeBuilder::BOOLEAN_ATTRIBUTES, /\Adata-/, /\Aaria-/ compile_boolean!(temple, key, values) else compile_common!(temple, key, values) end end temple end