module Haml::AttributeBuilder

def flatten_attributes(attributes)

def flatten_attributes(attributes)
  flattened = {}
  attributes.each do |key, value|
    case value
    when attributes
    when Hash
      flatten_attributes(value).each do |k, v|
        if k.nil?
          flattened[key] = v
        else
          flattened["#{key}-#{k.to_s.gsub(/_/, '-')}"] = v
        end
      end
    else
      flattened[key] = value if value
    end
  end
  flattened
end