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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b98a7a325e5887e7d31ed8cd9bd94ddffbf710c0
4
- data.tar.gz: 376a0544ba0ecb6dafb9f03eceb3b8c06a9b8568
3
+ metadata.gz: 3a1047f444d1dbb258203a517bd5d3796c37ec80
4
+ data.tar.gz: 304ba74c43b9d327edaecbdddc7f421735fa8715
5
5
  SHA512:
6
- metadata.gz: beb5456c396ec2ff2e0ce9ca7732f166034967069d31980bc59bddc1d6c82ac89464db5f2e2fb6e7eba459b536292c29be571a443de1191e2c2c150f12585141
7
- data.tar.gz: ed3d0a0c564787145df22682b0600eff02e2466096131a060d15881a285a6f6f7de406ff1929ec1f417fe2ec2726a4354987f20e48f4efbaef5845360c045aa3
6
+ metadata.gz: cc08012c81428eca6d28da305fe54ae3b82883b7482399194a759c6c132bbb7c2593fc6e3405f4917242cc344ff43af374c598fe5b8338a8eb7ca61223e8b9ae
7
+ data.tar.gz: 5249f1878070a99a0522a50c197c667d357466e316181e30f991bb7efb1b92abaec02a0402b5c921b7afed4d4725565f524aa6823145cb9d3040ae748f93cbfe
@@ -8,10 +8,10 @@ module Geoip4rails
8
8
  HTTParty.get("http://freegeoip.net/#{format}/#{ip}")
9
9
  end
10
10
 
11
- def geolocation
12
- ip = request.remote_ip
13
- HTTParty.get("http://freegeoip.net/json/#{ip}")
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
- # def country
26
-
27
- # end
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
@@ -1,3 +1,3 @@
1
1
  module Geoip4rails
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoip4rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - muaad