cargowise 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,7 @@ require 'cargowise/shipments_client'
19
19
  require 'cargowise/abstract_result'
20
20
  require 'cargowise/order'
21
21
  require 'cargowise/shipment'
22
+ require 'cargowise/packing'
22
23
  require 'cargowise/consol'
23
24
  require 'cargowise/document'
24
25
  require 'cargowise/invoice'
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+
3
+ module Cargowise
4
+
5
+ # Extra packing detail associated with a Shipment. Not built
6
+ # directly, but available via the packings attribute
7
+ # of the Shipment model.
8
+ #
9
+ class Packing < AbstractResult
10
+
11
+ attr_reader :pack_type, :line_price, :weight, :volume, :description
12
+
13
+ def initialize(node)
14
+ @node = node
15
+
16
+ @pack_type = text_value("./PackType")
17
+ @line_price = decimal_value("./LinePrice")
18
+ @weight = decimal_value("./Weight")
19
+ @volume = decimal_value("./Volume")
20
+ @description = text_value("./Description")
21
+ end
22
+ end
23
+ end
@@ -29,7 +29,7 @@ module Cargowise
29
29
 
30
30
  attr_reader :consignee_name
31
31
 
32
- attr_reader :consols, :documents, :invoices
32
+ attr_reader :consols, :packings, :documents, :invoices
33
33
 
34
34
  def initialize(node)
35
35
  @node = node
@@ -53,6 +53,10 @@ module Cargowise
53
53
  Consol.new(node)
54
54
  }
55
55
 
56
+ @packings = node_array("./Packings/Packing").map { |node|
57
+ Packing.new(node)
58
+ }
59
+
56
60
  @documents = node_array("./DocumentLinks/DocumentLink").map { |node|
57
61
  Document.new(node)
58
62
  }.sort_by { |doc|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cargowise
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 1
10
- version: 0.8.1
9
+ - 2
10
+ version: 0.8.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Healy
@@ -96,6 +96,7 @@ files:
96
96
  - lib/cargowise/abstract_search.rb
97
97
  - lib/cargowise/order.rb
98
98
  - lib/cargowise/abstract_result.rb
99
+ - lib/cargowise/packing.rb
99
100
  - lib/cargowise/order_search.rb
100
101
  - lib/cargowise/document.rb
101
102
  - lib/cargowise/endpoint.rb