unforlogistics-api 0.11 → 0.12
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/unforlogistics/core/shipments.rb +8 -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: 9b65a05d90edb76310e8319f87acd087d5a03869
         | 
| 4 | 
            +
              data.tar.gz: c991fb196ea7b286e71a582ea1955cec851d32f1
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 82ef33d74f1d1af5c9797699a7ea8749ea80ed0e205082ac7afd65b9296c1cf2c6416bf3b32a68b54c411651fc528c6c9aca60c9c61c0a175e04da145e7feac3
         | 
| 7 | 
            +
              data.tar.gz: 96881095aff1da9745acd2816f949ad6f98d997bb83d513ce940d976c482d16215085cf8b059e23d81bab02fff9f800400f4a6ed0ef9265e58f66854376b0683
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| @@ -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 | 
            -
                       | 
| 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. | 
| 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- | 
| 11 | 
            +
            date: 2017-10-22 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |