limiter-ruby 0.2.3 → 0.2.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
  SHA256:
3
- metadata.gz: a9ba8ac345e89fbc58649c0c06431b2ce0029d80c3973ca245783d754a24b6f3
4
- data.tar.gz: 51dd4e3fea76756e19af4fc80bab6dd65e9ce3f98142e51aff291062ea4e653a
3
+ metadata.gz: 96c4939d6e56cfa24e78beec860c0a19777d28af350de443db9c2c344a0f683f
4
+ data.tar.gz: c8e52e373ba57da0c3499ed5216003c193f55bf20fc3571ae106c8efd8ef22c8
5
5
  SHA512:
6
- metadata.gz: 111c8a224408fab34f680f2772ad2c171df274bbe8aa67ba20a95484b92ab785dba9f1cb341a337325a5633fe2a3713678cc57c15f162ef3a5da8c3b449a8f6d
7
- data.tar.gz: bd53e9bd59342b45898b32e71d3f4c904fbbff547cc1439756490d18b672a2ac544a511efe99f567f3fc9f76f4c8021449e998861421697e7abe2da66199b7e6
6
+ metadata.gz: 61d1e3e3e19402fd2e198b7e6cbb0686e173c268dea99f95cacf34942b962e93098dd92e5748c2f9eb4083063c0ae51183005cf38d49fda8206bd607a996d5ad
7
+ data.tar.gz: 60bcdb87f03d1a80713fc0d1b50c92050b01dcd187a0d3743f234a56ee7b141b72ffe97a463b688474378ef6d465f57e916c4aee21a9fdc8efecf7cf428ac27c
@@ -3,6 +3,8 @@
3
3
  module Limiter
4
4
  class Client
5
5
 
6
+ BASE_URL = "https://api.limiter.dev"
7
+
6
8
  attr_reader :namespace, :limit, :interval, :identifier, :token, :response
7
9
  delegate :exhausted?, :allowed?, :exceeded?, :resets_in, :to => :response
8
10
 
@@ -48,7 +50,7 @@ module Limiter
48
50
  HTTP
49
51
  .auth("Bearer #{Limiter.configuration.api_token}")
50
52
  .headers("User-Agent" => "Limiter-Ruby/#{Limiter::VERSION}")
51
- .get(Limiter.configuration::API_BASE_URL + limiter_path, params: params)
53
+ .get(BASE_URL + limiter_path, params: params)
52
54
  end
53
55
  end
54
56
  end
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Limiter
2
4
  class Configuration
3
- API_BASE_URL = "https://api.limiter.dev"
4
5
 
5
6
  attr_accessor :api_token, :raise_errors
6
7
 
@@ -6,7 +6,7 @@ module Limiter
6
6
  delegate :remaining, :points, :to => :response
7
7
 
8
8
  def limiter_path
9
- "/pts/#{namespace}/#{limit}/#{formatted_period}/#{identifier}"
9
+ "/pts/#{namespace}/#{limit}/#{formatted_interval}/#{identifier}"
10
10
  end
11
11
 
12
12
  def used(points)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Limiter
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limiter-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bilal Budhani