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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a33d6af11b8d67d5a080754976bd05ff8ba813f38efb6db9a3381c92036bd930
4
- data.tar.gz: d239858728b124cddd09b0a00457d84867b9fb243733243c531ddab3160c8948
3
+ metadata.gz: a7eacf7a25a81f8c8b29ea2640cd5203a2a79c1c58aa324866232d15c8b01e3b
4
+ data.tar.gz: dca5a0f63fb95340bc6a173d9752929e88f862d3764e95eb77df5d93f4b8a69f
5
5
  SHA512:
6
- metadata.gz: 5631d4b842b7f788bddaeb5b80861b84049ca08041f97d17205855264fdc2106244a508a87ba9062a63b586b3c552726f28ba7d9a73d27f3bea002b812a3f87b
7
- data.tar.gz: 749388d9a14e2caadf1669a263d5ae2e64c7152146b5c469e27a1ea5a889ce1dc36cf02db0c281012dde0364bbece6732077cfd562a497f5cb46acd09a0cc340
6
+ metadata.gz: ddaf0f56aef66e343780fcd2a3578d7a225f99d03bf5ee381e010e22ea0fa8a5491549a3b0f23358e0ece986d0841eb4d843f419cf9cd646ea41289103e30f25
7
+ data.tar.gz: 860f40ee986728f1fabc5125bf20edc3ffb3099746cd689cb755d3366556f6b5b892364c70c25b716e17c76d5b11f13837e0a8cb404e17c5bfca9afe6dbc620c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubg (0.2.0)
4
+ rubg (0.2.1)
5
5
  httparty (~> 0.16.2)
6
6
  json
7
7
 
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 Objects
152
+ ### RUBG Classes
147
153
 
148
154
  #### RUBG::Player
149
155
 
@@ -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]
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RUBG
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -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{Unofficial PUBG API wrapper gem for Ruby.}
13
- spec.description = %q{Unofficial PUBG API wrapper gem for Ruby.}
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.0
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: Unofficial PUBG API wrapper gem for Ruby.
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: Unofficial PUBG API wrapper gem for Ruby.
135
+ summary: RUBG is a Ruby wrapper for the official PUBG API.
136
136
  test_files: []