ipinfoapi 1.0.1 → 1.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ipinfoapi.rb +5 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08a536b6a14eb7979f80655c80f1a7f2fbe8772e0d7b2f89e8cb5bf950eba7d3'
4
- data.tar.gz: af88c1f8146a6db54b21bee20dfefee835576e6b6f0617dcd7170374789fb638
3
+ metadata.gz: 171721dc25d07885a8c738cbf5d246bb6b9ba339a061d38ba935e5dfb214ff99
4
+ data.tar.gz: d8e0db99a19e9a57f5b60aadc19dd0f39f85b68e02344f1eabbd7a9c5f50bcf5
5
5
  SHA512:
6
- metadata.gz: 0e04dc1388697b67135a910f5a5323d6c687d406de7a97de91808218f822cc8c3ac008b4c62a557a4b427f4129e4439cbd89666490b38f9f8c8bfa324cb9bd77
7
- data.tar.gz: 8f68af702331338421b1539ad12710f7086235acd1231b36605fe96207bac454fe61dbc27ccf2ad9dde017b55a9e784b4569acd7778a857fd8eaf3026b825a44
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(id)
5
- @id = 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.1
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-18 00:00:00.000000000 Z
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