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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d73c3eaf3525595e95f21ca48fb2217fd566899
4
- data.tar.gz: d45329f75e0b049ceff0b374b241faee4322df2f
3
+ metadata.gz: f1177833638b0c28803459d8331025da54f2fae6
4
+ data.tar.gz: 57b01c71dcfdae7394d4d7b1f175c8f27d435166
5
5
  SHA512:
6
- metadata.gz: 4eb21c50a7ef43dae2b59bfebd27fd3050540d640638ce99ba5d0b26f579de4b43cd0e458d6f4e83b037fe28295edbba0c300de8f2ac034a79762c28df026539
7
- data.tar.gz: 4c7f3a50da749b7ce55d69a70508db724af451969af26c8ba5da2d404102ea0953fc2b65a02d1f456aec92365c19f2b90e7e5479d14b90226e98313632037639
6
+ metadata.gz: a7db6850029ca84dd8df1d9e0f604d512dd6dc930f1d7a975ede64d42fe068c8b1beae4c9cfd8b945258cdd85089e624b7f62a4f85b7529469152b78bf7adaa9
7
+ data.tar.gz: 2883328f43a6d02323be5341ceb5f04728b8fa20f78c8ab060a3f1bec8e74f3d7f1b5bd11957d97e76ec47c3c64295d6eaf5acf7d20d16f67d0652577b5f452f
@@ -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, IndifferentHash
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
- raw_response[:code]
23
+ response_body[:code]
20
24
  end
21
25
 
22
26
  def default_message
23
- raw_response[:message]
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
@@ -7,11 +7,11 @@ module XEClient
7
7
  private
8
8
 
9
9
  def default_from
10
- raw_response[:from]
10
+ response_body[:from]
11
11
  end
12
12
 
13
13
  def default_to
14
- raw_response[:to].map do |quote_hash|
14
+ response_body[:to].map do |quote_hash|
15
15
  Quote.new(quote_hash)
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module XEClient
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-06-29 00:00:00.000000000 Z
11
+ date: 2016-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport