I wouldn’t override .flatten, which is already defined:
Returns a new array that is a
one-dimensional flattening of this
hash. That is, for every key or value
that is an array, extract its elements
into the new array. Unlike
Array#flatten, this method does not
flatten recursively by default. If the
optional level argument determines the
level of recursion to flatten.
This is simplest way to do it that I’m aware of:
{:a => 100, :b => 200}.map{|k,v| "#{k}=#{v}"}.join('&')
# => "a=100&b=200"