module Haml::AttributeBuilder

def build(escape_attrs, quote, format, object_ref, *hashes)

def build(escape_attrs, quote, format, object_ref, *hashes)
  hashes << Haml::ObjectRef.parse(object_ref) if object_ref
  buf  = []
  hash = merge_all_attrs(hashes)
  keys = hash.keys.sort!
  keys.each do |key|
    case key
    when 'id'
      buf << " id=#{quote}#{build_id(escape_attrs, *hash[key])}#{quote}"
    when 'class'
      buf << " class=#{quote}#{build_class(escape_attrs, *hash[key])}#{quote}"
    when 'data'
      buf << build_data(escape_attrs, quote, *hash[key])
    when 'aria'
      buf << build_aria(escape_attrs, quote, *hash[key])
    when *Haml::BOOLEAN_ATTRIBUTES, /\Adata-/, /\Aaria-/
      build_boolean!(escape_attrs, quote, format, buf, key, hash[key])
    else
      buf << " #{key}=#{quote}#{escape_html(escape_attrs, hash[key].to_s)}#{quote}"
    end
  end
  buf.join
end