class QueryStringParser
  def self.parse(query_string)
    result = {}
    query_string.split('&').each do |pair|
      key, value = pair.split('=')
      unless value.nil?
        result[key] ||= []
        result[key] << value
      end
    end
    result
  end
end

class QueryStringParser
  def self.parse(query_string)
    result = {}
    URI.decode_www_form(query_string).each do |pair|
      key, value = pair
      unless value.nil? || value.empty?
        result[key] ||= []
        result[key] << value
      end
    end
    result
  end
end

Refactor QueryStringParser to use URI.decode_www_form
3342: Refactor QueryStringParser to use URI.decode_www_form

Authors: 2b40485fded67597eeee301cb96e815f61af979c@chrisholmes
