wes-data-api 6.1.0 → 6.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wes/data/api.rb +1 -1
- data/lib/wes/data/api/response.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 502ea4512a30200c3d773d34ca3c7db769b61e48
|
4
|
+
data.tar.gz: 72810c0e7e76ef94bf03640b7077fea2c44e24e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f52cb8801ac36105e978471d36db316b30990e840c68a27a4b02d137c02b617ce13b9874673421ffff6df31248bd5b9b0949dfae568795a60687f44b8a43a5b9
|
7
|
+
data.tar.gz: fa7e6eaa280153ab50998c1a6af14b63c83139f93f4fdcc2f74acabf3c6a8277853cf6dec0538251207923d8d4cd3be6fc4206f9a0f1445b89fe7d3872af1e29
|
data/lib/wes/data/api.rb
CHANGED
@@ -10,16 +10,22 @@ module Wes
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def build
|
13
|
-
raise unexpected_error unless response
|
14
|
-
raise api_error unless response.status
|
13
|
+
raise unexpected_error unless valid_response(response)
|
14
|
+
raise api_error unless VALID_RESPONSE_CODES.include?(response.status)
|
15
15
|
data = response.body || {}
|
16
16
|
data.map { |e| OpenStruct.new e }
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
|
+
VALID_RESPONSE_CODES = [200, 204]
|
22
|
+
|
21
23
|
attr_reader :response
|
22
24
|
|
25
|
+
def valid_response(response)
|
26
|
+
response.body || response.status == 204
|
27
|
+
end
|
28
|
+
|
23
29
|
def error_details
|
24
30
|
response.body.fetch("details")
|
25
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wes-data-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|