berbix 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/lib/berbix.rb +5 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98b6319a50dfd32695ad42cc0052df8c7804c4b002c65764ba77ee4db4dc3096
|
4
|
+
data.tar.gz: ac7ccb91f56cd327f1feee441e029e7cf8d340a1f38d16218ea53f104e4eb0db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1372ae1a4809b4dc43b537f214cbe2e0caabbfc4bbaa0e1c0e12edb83dbfa927807199b33be2e98bd5b77a7d5fbfa0061a46beeba64b8c2382dd4bda6390e9df
|
7
|
+
data.tar.gz: 95b9ac13c41f8b2335562858875beb65f49b1571f19abe363e5ac9cea0a98d6ea57eed512e319c79585a7be979b5966a46cc01b548082faba3e44b0f9f9f8b77
|
data/lib/berbix.rb
CHANGED
@@ -3,7 +3,7 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Berbix
|
5
5
|
|
6
|
-
SDK_VERSION = '0.0.
|
6
|
+
SDK_VERSION = '0.0.6'
|
7
7
|
CLOCK_DRIFT = 300
|
8
8
|
|
9
9
|
class HTTPClient
|
@@ -70,16 +70,12 @@ module Berbix
|
|
70
70
|
|
71
71
|
class Client
|
72
72
|
def initialize(opts={})
|
73
|
-
@
|
74
|
-
@client_secret = opts[:client_secret]
|
73
|
+
@api_secret = opts[:api_secret] || opts[:client_secret]
|
75
74
|
@api_host = api_host(opts)
|
76
75
|
@http_client = opts[:http_client] || NetHTTPClient.new
|
77
76
|
|
78
|
-
if @
|
79
|
-
raise ':
|
80
|
-
end
|
81
|
-
if @client_secret.nil?
|
82
|
-
raise ':client_secret must be provided when instantiating Berbix client'
|
77
|
+
if @api_secret.nil?
|
78
|
+
raise ':api_secret must be provided when instantiating Berbix client'
|
83
79
|
end
|
84
80
|
end
|
85
81
|
|
@@ -182,7 +178,7 @@ module Berbix
|
|
182
178
|
end
|
183
179
|
|
184
180
|
def auth
|
185
|
-
{ user: @
|
181
|
+
{ user: @api_secret, pass: '' }
|
186
182
|
end
|
187
183
|
|
188
184
|
def api_host(opts)
|