gmaps_gem 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gmaps_gem.rb +5 -5
- metadata +1 -1
data/lib/gmaps_gem.rb
CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
|
|
2
2
|
require 'json'
|
3
3
|
require 'net/http'
|
4
4
|
|
5
|
-
class
|
6
|
-
class << self
|
7
|
-
def geocode(address)
|
5
|
+
class ActiveRecord::Base
|
6
|
+
#class << self
|
7
|
+
def self.geocode(address)
|
8
8
|
url = "http://maps.googleapis.com/maps/api/geocode/json?address=#{address}&sensor=true"
|
9
9
|
resp = Net::HTTP.get_response(URI.parse(url))
|
10
10
|
data = resp.body
|
@@ -18,7 +18,7 @@ class Place
|
|
18
18
|
@latlng = [lat,lng]
|
19
19
|
end
|
20
20
|
|
21
|
-
def reverse_geocode(lat,lng)
|
21
|
+
def self.reverse_geocode(lat,lng)
|
22
22
|
url = "http://maps.googleapis.com/maps/api/geocode/json?latlng=#{lat},#{lng}&sensor=true"
|
23
23
|
resp = Net::HTTP.get_response(URI.parse(url))
|
24
24
|
data = resp.body
|
@@ -28,6 +28,6 @@ class Place
|
|
28
28
|
@address = a["results"].first["address_components"].first["long_name"]
|
29
29
|
#puts address
|
30
30
|
end
|
31
|
-
end
|
31
|
+
#end
|
32
32
|
end
|
33
33
|
|