unforlogistics-api 0.11 → 0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f7c016ab826994f4acce3bfb8bbf1898a5c8ac1
4
- data.tar.gz: 8c8394ac4e9318a536a5def99f58df367788f318
3
+ metadata.gz: 9b65a05d90edb76310e8319f87acd087d5a03869
4
+ data.tar.gz: c991fb196ea7b286e71a582ea1955cec851d32f1
5
5
  SHA512:
6
- metadata.gz: 578ca391924e64c19afb8013fda76d599347e9bed6c22dee7c846a884757b6ac1a54d6a923803a2cf2da3ec6e2a82bf4ee0f942d80c889a276684aef1012b095
7
- data.tar.gz: 90bd3175a52a8fd0e7d206fe97b181b96a4b8f89eb7eadefc0fef503abdc785b4614f3237af1c6abb33e2c781c3a7e2c2f9c21ebf73b9723be58d2f4caa3b13c
6
+ metadata.gz: 82ef33d74f1d1af5c9797699a7ea8749ea80ed0e205082ac7afd65b9296c1cf2c6416bf3b32a68b54c411651fc528c6c9aca60c9c61c0a175e04da145e7feac3
7
+ data.tar.gz: 96881095aff1da9745acd2816f949ad6f98d997bb83d513ce940d976c482d16215085cf8b059e23d81bab02fff9f800400f4a6ed0ef9265e58f66854376b0683
data/CHANGELOG.md CHANGED
@@ -41,3 +41,7 @@
41
41
  ## v0.11
42
42
 
43
43
  * Fix syntax errors on shipments
44
+
45
+ ## v0.12
46
+
47
+ * Fixed format on shipment quote
@@ -25,15 +25,22 @@ module Unforlogistics
25
25
 
26
26
  def quote_shipment(attrs={})
27
27
  response = post_request('/shipments/quote', attrs)
28
+ results = response.body
28
29
 
29
30
  if response.headers.warning.nil?
30
31
  errors = []
32
+
33
+ results.each do |result|
34
+ result.price = BigDecimal.new(result.price)
35
+ result.surcharge = BigDecimal.new(result.surcharge)
36
+ result.total = BigDecimal.new(result.total)
37
+ end
31
38
  else
32
39
  errors = response.headers.warning
33
40
  end
34
41
 
35
42
  OpenStruct.new({
36
- result: response.body,
43
+ results: results,
37
44
  valid: errors.empty?,
38
45
  errors: errors
39
46
  })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unforlogistics-api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.11'
4
+ version: '0.12'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-21 00:00:00.000000000 Z
11
+ date: 2017-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler