lib/geokit/geocoders/base_ip.rb in geokit-1.8.1 vs lib/geokit/geocoders/base_ip.rb in geokit-1.8.2
- old
+ new
@@ -28,9 +28,14 @@
def self.ip?(ip)
/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})?$/.match(ip)
end
+ def self.process(format, ip)
+ return GeoLoc.new unless valid_ip?(ip)
+ super(format, submit_url(ip))
+ end
+
# Checks whether the IP address belongs to a private address range.
#
# This function is used to reduce the number of useless queries made to
# the geocoding service. Such queries can occur frequently during
# integration tests.