class Patron::Request

def hash_to_string(hash)

serialize hash for Rails-style params
def hash_to_string(hash)
  pairs = []
  recursive = Proc.new do |h, prefix| 
    h.each_pair do |k,v|
      key = prefix == '' ? k : "#{prefix}[#{k}]"
      v.is_a?(Hash) ? recursive.call(v, key) : pairs << "#{key}=#{v}"
    end
  end
  recursive.call(hash, '')
  return pairs.join('&')
end