lib/google_geocode.rb in google-geocode-1.2.0 vs lib/google_geocode.rb in google-geocode-1.2.1

- old
+ new

@@ -1,15 +1,21 @@ +require 'rubygems' require 'rc_rest' ## # Library for looking up coordinates with Google's Geocoding API. # # http://www.google.com/apis/maps/documentation/#Geocoding_HTTP_Request class GoogleGeocode < RCRest ## + # This is the version you are running. + + VERSION = '1.2.1' + + ## # Base error class class Error < RCRest::Error; end ## @@ -33,18 +39,18 @@ # # http://www.google.com/apis/maps/signup.html def initialize(key) @key = key - @url = URI.parse 'http://maps.google.com/maps/geo' + @url = URI.parse 'http://maps.google.com/maps/' end ## # Locates +address+ returning a Location struct. def locate(address) - get :q => address + get :geo, :q => address end ## # Extracts a Location from +xml+. @@ -85,14 +91,14 @@ ## # Creates a URL from the Hash +params+. Automatically adds the key and # sets the output type to 'xml'. - def make_url(params) + def make_url(method, params) params[:key] = @key params[:output] = 'xml' - super params + super method, params end end ##