embloy 0.1.5 → 0.1.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/embloy/client.rb +4 -3
- 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: 2517da4b71b48dd5958637b4bb93483540449872cfdf101e5a70b6b492bf7540
|
|
4
|
+
data.tar.gz: 8720cb21e3dcbd5a0b849113d1d5624869b41d4d7052560702a02a4f2c4f6f47
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '08d82ef2c2b3e618d99281b0a0dfa4df6d4dd6c05263cb8c15623f60d35e35d00cc41372bfd51951ee11a87aba8340366412fc0607ec7235fcbb4a327e9e15e5'
|
|
7
|
+
data.tar.gz: 4ecb57cf2a85b742b327a2901122463e33a4682f5e291dca296073ee38969d31236e0490dafbc63b39b2f2811fc6b502da393ab6e60e6abfc796809e2f7eacb3
|
data/lib/embloy/client.rb
CHANGED
|
@@ -6,12 +6,13 @@ module Embloy
|
|
|
6
6
|
def initialize(client_token, session)
|
|
7
7
|
@client_token = client_token
|
|
8
8
|
@session = session
|
|
9
|
-
@
|
|
9
|
+
@api_url = 'https://api.embloy.com'
|
|
10
|
+
@base_url = 'https://embloy.com'
|
|
10
11
|
@api_version = 'api/v0'
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def make_request
|
|
14
|
-
uri = URI("#{@
|
|
15
|
+
uri = URI("#{@api_url}/#{@api_version}/sdk/request/auth/token")
|
|
15
16
|
https = Net::HTTP.new(uri.host, uri.port)
|
|
16
17
|
https.use_ssl = true
|
|
17
18
|
request = Net::HTTP::Post.new(uri)
|
|
@@ -31,7 +32,7 @@ module Embloy
|
|
|
31
32
|
case response
|
|
32
33
|
when Net::HTTPSuccess
|
|
33
34
|
request_token = JSON.parse(response.body)['request_token']
|
|
34
|
-
"#{@base_url}/sdk/apply?
|
|
35
|
+
"#{@base_url}/sdk/apply?request_token=#{request_token}"
|
|
35
36
|
else
|
|
36
37
|
raise StandardError, "Error making request: #{response.message}"
|
|
37
38
|
end
|