rubg 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +7 -1
- data/lib/rubg/client.rb +1 -1
- data/lib/rubg/rubg_endpoint.rb +5 -1
- data/lib/rubg/version.rb +1 -1
- data/rubg.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7eacf7a25a81f8c8b29ea2640cd5203a2a79c1c58aa324866232d15c8b01e3b
|
4
|
+
data.tar.gz: dca5a0f63fb95340bc6a173d9752929e88f862d3764e95eb77df5d93f4b8a69f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddaf0f56aef66e343780fcd2a3578d7a225f99d03bf5ee381e010e22ea0fa8a5491549a3b0f23358e0ece986d0841eb4d843f419cf9cd646ea41289103e30f25
|
7
|
+
data.tar.gz: 860f40ee986728f1fabc5125bf20edc3ffb3099746cd689cb755d3366556f6b5b892364c70c25b716e17c76d5b11f13837e0a8cb404e17c5bfca9afe6dbc620c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -98,6 +98,8 @@ response.players # collection of player objects
|
|
98
98
|
response.response_ts # Time object containing date/time of response
|
99
99
|
response.ratelimit # Returns the max rate limit/min for your API key.
|
100
100
|
response.ratelimit_remaining # Returns the number of requests your API key has remaining before hitting the ratelimit.
|
101
|
+
response.ratelimit_reset # Timestamp of ratelimit reset as Integer (Epoch seconds).
|
102
|
+
response.ratelimit_reset_in # Seconds until ratelimit reset.
|
101
103
|
```
|
102
104
|
|
103
105
|
|
@@ -118,6 +120,8 @@ response = client.player(args)
|
|
118
120
|
response.response_ts # Time object containing date/time of response
|
119
121
|
response.ratelimit # Returns the max rate limit/min for your API key.
|
120
122
|
response.ratelimit_remaining # Returns the number of requests your API key has remaining before hitting the ratelimit.
|
123
|
+
response.ratelimit_reset # Timestamp of ratelimit reset as Integer (Epoch seconds).
|
124
|
+
response.ratelimit_reset_in # Seconds until ratelimit reset.
|
121
125
|
```
|
122
126
|
|
123
127
|
|
@@ -138,12 +142,14 @@ response = client.match(args)
|
|
138
142
|
response.response_ts # Time object containing date/time of response
|
139
143
|
response.ratelimit # Returns the max rate limit/min for your API key.
|
140
144
|
response.ratelimit_remaining # Returns the number of requests your API key has remaining before hitting the ratelimit.
|
145
|
+
response.ratelimit_reset # Timestamp of ratelimit reset as Integer (Epoch seconds).
|
146
|
+
response.ratelimit_reset_in # Seconds until ratelimit reset.
|
141
147
|
|
142
148
|
```
|
143
149
|
|
144
150
|
|
145
151
|
|
146
|
-
### RUBG
|
152
|
+
### RUBG Classes
|
147
153
|
|
148
154
|
#### RUBG::Player
|
149
155
|
|
data/lib/rubg/client.rb
CHANGED
@@ -6,7 +6,7 @@ module RUBG
|
|
6
6
|
base_uri 'https://api.playbattlegrounds.com'
|
7
7
|
attr_accessor :api_key, :content_type, :gzip
|
8
8
|
|
9
|
-
def initialize( args )
|
9
|
+
def initialize( args={} )
|
10
10
|
args = self.class.defaults.merge(args)
|
11
11
|
@api_key = args[:api_key]
|
12
12
|
@content_type = args[:content_type]
|
data/lib/rubg/rubg_endpoint.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module RUBG
|
2
2
|
class RubgEndpoint
|
3
|
-
attr_reader :errors, :data, :response_ts, :ratelimit, :ratelimit_remaining, :raw_response
|
3
|
+
attr_reader :errors, :data, :response_ts, :ratelimit, :ratelimit_remaining, :ratelimit_reset, :raw_response
|
4
4
|
|
5
5
|
def initialize( args )
|
6
6
|
args = self.class.defaults.merge(args)
|
@@ -9,6 +9,7 @@ module RUBG
|
|
9
9
|
@response_ts = Time.parse(args[:response].headers['date']) if args[:response].headers['date']
|
10
10
|
@ratelimit = args[:response].headers['x-ratelimit-limit']
|
11
11
|
@ratelimit_remaining = args[:response].headers['x-ratelimit-remaining']
|
12
|
+
@ratelimit_reset = args[:response].headers['x-ratelimit-reset'].to_i
|
12
13
|
@raw_response = args[:response]
|
13
14
|
end
|
14
15
|
|
@@ -37,6 +38,9 @@ module RUBG
|
|
37
38
|
return @response
|
38
39
|
end
|
39
40
|
|
41
|
+
def ratelimit_reset_in
|
42
|
+
@ratelimit_reset.to_i - Time.now.to_i
|
43
|
+
end
|
40
44
|
|
41
45
|
|
42
46
|
private
|
data/lib/rubg/version.rb
CHANGED
data/rubg.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Dor"]
|
10
10
|
spec.email = ["dor.edras@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{RUBG is a Ruby wrapper for the official PUBG API.}
|
13
|
+
spec.description = %q{RUBG is a Ruby wrapper for the official PUBG API.}
|
14
14
|
spec.homepage = "https://github.com/dor-edras/rubg"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dor
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description:
|
83
|
+
description: RUBG is a Ruby wrapper for the official PUBG API.
|
84
84
|
email:
|
85
85
|
- dor.edras@gmail.com
|
86
86
|
executables: []
|
@@ -132,5 +132,5 @@ rubyforge_project:
|
|
132
132
|
rubygems_version: 2.7.6
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
|
-
summary:
|
135
|
+
summary: RUBG is a Ruby wrapper for the official PUBG API.
|
136
136
|
test_files: []
|