diff --git a/lib/geocoder/query.rb b/lib/geocoder/query.rb index ed438610daf36efda133f016238659cbb5b626a8..d0f4469e6c4c719b0c5fd3dd7da8c71cd75904d2 100644 --- a/lib/geocoder/query.rb +++ b/lib/geocoder/query.rb @@ -42,8 +42,9 @@ module Geocoder # no URL parameters are specified. # def blank? - !!text.to_s.match(/^\s*$/) and ( - !options[:params].is_a?(Hash) or options[:params].keys.size == 0 + !params_given? and ( + (text.is_a?(Array) and text.compact.size < 2) or + text.to_s.match(/^\s*$/) ) end @@ -88,5 +89,11 @@ module Geocoder def reverse_geocode? coordinates? end + + private # ---------------------------------------------------------------- + + def params_given? + !!(options[:params].is_a?(Hash) and options[:params].keys.size > 0) + end end end