xe_client 0.2.0 → 0.2.1
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/CHANGELOG.md +4 -0
- data/lib/xe_client/responses/base_response.rb +11 -3
- data/lib/xe_client/responses/convert_from_response.rb +2 -2
- data/lib/xe_client/version.rb +1 -1
- 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: f1177833638b0c28803459d8331025da54f2fae6
|
4
|
+
data.tar.gz: 57b01c71dcfdae7394d4d7b1f175c8f27d435166
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7db6850029ca84dd8df1d9e0f604d512dd6dc930f1d7a975ede64d42fe068c8b1beae4c9cfd8b945258cdd85089e624b7f62a4f85b7529469152b78bf7adaa9
|
7
|
+
data.tar.gz: 2883328f43a6d02323be5341ceb5f04728b8fa20f78c8ab060a3f1bec8e74f3d7f1b5bd11957d97e76ec47c3c64295d6eaf5acf7d20d16f67d0652577b5f452f
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
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
|
+
## [0.2.1] - 2016-08-11
|
6
|
+
### Fixed
|
7
|
+
- Fix issue when accessing ConvertFromResponse#to and error was raised
|
8
|
+
|
5
9
|
## [0.2.0] - 2016-06-30
|
6
10
|
### Added
|
7
11
|
- Raise XEClient::AuthenticationError when there's an auth issue
|
@@ -2,7 +2,11 @@ module XEClient
|
|
2
2
|
class BaseResponse
|
3
3
|
|
4
4
|
include Virtus.model
|
5
|
-
attribute :raw_response
|
5
|
+
attribute :raw_response
|
6
|
+
attribute(:response_body, IndifferentHash, {
|
7
|
+
lazy: true,
|
8
|
+
default: :default_response_body,
|
9
|
+
})
|
6
10
|
attribute :code, Integer, lazy: true, default: :default_code
|
7
11
|
attribute :message, String, lazy: true, default: :default_message
|
8
12
|
attribute :error, Object, lazy: true, default: :default_error
|
@@ -16,16 +20,20 @@ module XEClient
|
|
16
20
|
private
|
17
21
|
|
18
22
|
def default_code
|
19
|
-
|
23
|
+
response_body[:code]
|
20
24
|
end
|
21
25
|
|
22
26
|
def default_message
|
23
|
-
|
27
|
+
response_body[:message]
|
24
28
|
end
|
25
29
|
|
26
30
|
def default_error
|
27
31
|
Error.new_from_response(self)
|
28
32
|
end
|
29
33
|
|
34
|
+
def default_response_body
|
35
|
+
JSON.parse(raw_response.body)
|
36
|
+
end
|
37
|
+
|
30
38
|
end
|
31
39
|
end
|
data/lib/xe_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xe_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|