ipinfoapi 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ipinfoapi.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 171721dc25d07885a8c738cbf5d246bb6b9ba339a061d38ba935e5dfb214ff99
|
4
|
+
data.tar.gz: d8e0db99a19e9a57f5b60aadc19dd0f39f85b68e02344f1eabbd7a9c5f50bcf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b19f594623c0a10ba30ebbe6e7ec2c0a78bf1aba31c8ad60385b20e458aa1f3b66e7f6b8f5922d112c6beb3ca2b1f49862c086bff3c8927a10dc9f2f0919ed8
|
7
|
+
data.tar.gz: 355198e61cf89b95ad71dfde56d2b3f1a1400c79c8081da59d14ae9803c095aee1022520c442da9b0e950bb5a631ed18ca9256edca4b7f2816845eaae505d425
|
data/lib/ipinfoapi.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require "json"
|
3
3
|
class IPinfo
|
4
|
-
def initialize(
|
5
|
-
@id =
|
4
|
+
def initialize(ip)
|
5
|
+
@id = ip
|
6
6
|
url = URI.parse("http://ip-api.com/json/#{@id}")
|
7
7
|
req = Net::HTTP::Get.new(url.to_s)
|
8
8
|
res = Net::HTTP.start(url.host, url.port) {|http|
|
@@ -10,6 +10,9 @@ class IPinfo
|
|
10
10
|
}
|
11
11
|
@@re1 = JSON.parse(res.body)
|
12
12
|
end
|
13
|
+
def status
|
14
|
+
return @@re1['status']
|
15
|
+
end
|
13
16
|
def country
|
14
17
|
return @@re1['country']
|
15
18
|
end
|
@@ -49,6 +52,4 @@ class IPinfo
|
|
49
52
|
def query
|
50
53
|
return @@re1['query']
|
51
54
|
end
|
52
|
-
|
53
55
|
end
|
54
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipinfoapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NimaCpp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: information about ip
|
14
14
|
email: swithwebb31@email.com
|