Class: Cargowise::Packing

Inherits:
AbstractResult show all
Defined in:
lib/cargowise/packing.rb

Overview

Extra packing detail associated with a Shipment. Not built directly, but available via the packings attribute of the Shipment model.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractResult

endpoint, #inspect, register, via

Constructor Details

#initialize(node) ⇒ Packing

Returns a new instance of Packing.



13
14
15
16
17
18
19
20
21
# File 'lib/cargowise/packing.rb', line 13

def initialize(node)
  @node = node

  @pack_type   = text_value("./PackType")
  @line_price  = decimal_value("./LinePrice")
  @weight      = kg_value("./Weight")
  @volume      = cubic_value("./Volume")
  @description = text_value("./Description")
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



11
12
13
# File 'lib/cargowise/packing.rb', line 11

def description
  @description
end

#line_priceObject (readonly)

Returns the value of attribute line_price.



11
12
13
# File 'lib/cargowise/packing.rb', line 11

def line_price
  @line_price
end

#pack_typeObject (readonly)

Returns the value of attribute pack_type.



11
12
13
# File 'lib/cargowise/packing.rb', line 11

def pack_type
  @pack_type
end

#volumeObject (readonly)

Returns the value of attribute volume.



11
12
13
# File 'lib/cargowise/packing.rb', line 11

def volume
  @volume
end

#weightObject (readonly)

Returns the value of attribute weight.



11
12
13
# File 'lib/cargowise/packing.rb', line 11

def weight
  @weight
end