ezapi_client 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/ezapi_client/responses/base_response.rb +8 -1
- data/lib/ezapi_client/version.rb +1 -1
- 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: 23f3f08aa7781e5f8b56fb3762850658faf5615908f26c6bf69d533c3317ff40
|
4
|
+
data.tar.gz: 9b2c8d600f6d9e434b9dde451eae2be618be110208f9aaf3b26f019bc6396dfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3876343644d65cf75b669d0aecf2ec2c61add2507114c1a860e9da54e46c395535148b624789ed9c96e171b6b6cbca0dc1d35fd6cd9606ab2666b5730c863475
|
7
|
+
data.tar.gz: fcff3a8348f0bd5034157c605de5e55e66ed95146929f590bb19e76d16261e16cce39e69f8a67bedcd931905623944de43d0244f1d29516b743e4d505ddb6dd9
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [1.1.0] - 2019-05-27
|
6
|
+
### Added
|
7
|
+
- Response `#raw_body` to access the raw, unparsed body directly
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
- BaseResponse #code and #message are nil if #response_body is nil
|
11
|
+
|
5
12
|
## [1.0.3] - 2019-05-27
|
6
13
|
### Fixed
|
7
14
|
- EZAPI server couldn't parse escaped JSON; escape values instead of whole JSON instead
|
@@ -3,6 +3,7 @@ module EZAPIClient
|
|
3
3
|
|
4
4
|
include Virtus.model
|
5
5
|
attribute :raw_response, Object
|
6
|
+
attribute :raw_body, String, lazy: true, default: :default_raw_body
|
6
7
|
attribute(:response_body, IndifferentHash, {
|
7
8
|
lazy: true,
|
8
9
|
default: :default_response_body,
|
@@ -18,17 +19,23 @@ module EZAPIClient
|
|
18
19
|
response_body[:success]
|
19
20
|
end
|
20
21
|
|
22
|
+
def default_raw_body
|
23
|
+
raw_response.body
|
24
|
+
end
|
25
|
+
|
21
26
|
def default_response_body
|
22
|
-
JSON.parse(
|
27
|
+
JSON.parse(raw_body)
|
23
28
|
rescue JSON::ParserError
|
24
29
|
nil
|
25
30
|
end
|
26
31
|
|
27
32
|
def default_code
|
33
|
+
return nil if response_body.nil?
|
28
34
|
response_body[:code]
|
29
35
|
end
|
30
36
|
|
31
37
|
def default_message
|
38
|
+
return nil if response_body.nil?
|
32
39
|
response_body[:message]
|
33
40
|
end
|
34
41
|
|
data/lib/ezapi_client/version.rb
CHANGED