wes-data-api 6.2.0 → 7.0.0
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/wes/data/api.rb +1 -1
- data/lib/wes/data/api/request.rb +6 -4
- data/lib/wes/data/api/response.rb +3 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31b8615dcefa088ac76fc1cc49d39694847717cd
|
4
|
+
data.tar.gz: 34fc55122d7030b1085dc50b2b29abd786dca59a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ede67f67f12fc0f7c46fd8d237284ba153a0018ec47d797a749c837ab56b24d84138d004820a68297fde4d0668a4b1f76a4b0a2bdd0ac2a38efc81ade017ad91
|
7
|
+
data.tar.gz: 71d40e3b622d38b15d9d28b25ef4db7ceb3bbb3321ac37bf828b4d9c72da5729715e2f592dac94024394c968bab1e420736f91b5d7a0a7add0523a31bded224b
|
data/lib/wes/data/api.rb
CHANGED
data/lib/wes/data/api/request.rb
CHANGED
@@ -9,8 +9,9 @@ module Wes
|
|
9
9
|
class << self
|
10
10
|
def get(path)
|
11
11
|
connection.get do |r|
|
12
|
-
r.options.timeout
|
13
|
-
r.
|
12
|
+
r.options.timeout = TIMEOUT
|
13
|
+
r.headers["Content-Type"] = "application/json"
|
14
|
+
r.url complete_path(path)
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
@@ -34,8 +35,9 @@ module Wes
|
|
34
35
|
|
35
36
|
def delete(path)
|
36
37
|
connection.delete do |r|
|
37
|
-
r.options.timeout
|
38
|
-
r.
|
38
|
+
r.options.timeout = TIMEOUT
|
39
|
+
r.headers["Content-Type"] = "application/json"
|
40
|
+
r.url complete_path(path)
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
@@ -18,7 +18,7 @@ module Wes
|
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
|
-
VALID_RESPONSE_CODES = [200, 204]
|
21
|
+
VALID_RESPONSE_CODES = [200, 204].freeze
|
22
22
|
|
23
23
|
attr_reader :response
|
24
24
|
|
@@ -27,15 +27,11 @@ module Wes
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def error_details
|
30
|
-
response.body.fetch("
|
31
|
-
end
|
32
|
-
|
33
|
-
def error_status
|
34
|
-
response.body.fetch("status")
|
30
|
+
response.body.fetch("Error")
|
35
31
|
end
|
36
32
|
|
37
33
|
def api_error
|
38
|
-
Error::Response.new(
|
34
|
+
Error::Response.new(500, error_details)
|
39
35
|
end
|
40
36
|
|
41
37
|
def unexpected_error
|