class Geocoder::Lookup::Base

def hash_to_query(hash)


Removes any keys with nil value.
Simulate ActiveSupport's Object#to_query.
#
def hash_to_query(hash)
  require 'cgi' unless defined?(CGI) && defined?(CGI.escape)
  hash.collect{ |p|
    p[1].nil? ? nil : p.map{ |i| CGI.escape i.to_s } * '='
  }.compact.sort * '&'
end