geoip4rails 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geoip4rails.rb +25 -7
- data/lib/geoip4rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a1047f444d1dbb258203a517bd5d3796c37ec80
|
4
|
+
data.tar.gz: 304ba74c43b9d327edaecbdddc7f421735fa8715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc08012c81428eca6d28da305fe54ae3b82883b7482399194a759c6c132bbb7c2593fc6e3405f4917242cc344ff43af374c598fe5b8338a8eb7ca61223e8b9ae
|
7
|
+
data.tar.gz: 5249f1878070a99a0522a50c197c667d357466e316181e30f991bb7efb1b92abaec02a0402b5c921b7afed4d4725565f524aa6823145cb9d3040ae748f93cbfe
|
data/lib/geoip4rails.rb
CHANGED
@@ -8,10 +8,10 @@ module Geoip4rails
|
|
8
8
|
HTTParty.get("http://freegeoip.net/#{format}/#{ip}")
|
9
9
|
end
|
10
10
|
|
11
|
-
def geolocation
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
# def geolocation
|
12
|
+
# ip = request.remote_ip
|
13
|
+
# HTTParty.get("http://freegeoip.net/json/#{ip}")
|
14
|
+
# end
|
15
15
|
|
16
16
|
def country ip
|
17
17
|
find_by_ip(ip)["country_name"]
|
@@ -22,7 +22,25 @@ module Geoip4rails
|
|
22
22
|
def city ip
|
23
23
|
find_by_ip(ip)["city"]
|
24
24
|
end
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
def region_code ip
|
26
|
+
find_by_ip(ip)["region_code"]
|
27
|
+
end
|
28
|
+
def region_name ip
|
29
|
+
find_by_ip(ip)["region_name"]
|
30
|
+
end
|
31
|
+
def zipcode ip
|
32
|
+
find_by_ip(ip)["zipcode"]
|
33
|
+
end
|
34
|
+
def latitude ip
|
35
|
+
find_by_ip(ip)["latitude"]
|
36
|
+
end
|
37
|
+
def longitude ip
|
38
|
+
find_by_ip(ip)["longitude"]
|
39
|
+
end
|
40
|
+
def metro_code ip
|
41
|
+
find_by_ip(ip)["metro_code"]
|
42
|
+
end
|
43
|
+
def area_code ip
|
44
|
+
find_by_ip(ip)["area_code"]
|
45
|
+
end
|
28
46
|
end
|
data/lib/geoip4rails/version.rb
CHANGED