Class: Physical::Shipment
- Inherits:
-
Object
- Object
- Physical::Shipment
- Defined in:
- lib/physical/shipment.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
-
#pallets ⇒ Object
readonly
Returns the value of attribute pallets.
-
#service_code ⇒ Object
readonly
Returns the value of attribute service_code.
-
#structures ⇒ Object
readonly
Returns the value of attribute structures.
Instance Method Summary collapse
-
#initialize(id: nil, origin: nil, destination: nil, service_code: nil, pallets: [], structures: [], packages: [], options: {}) ⇒ Shipment
constructor
A new instance of Shipment.
Constructor Details
#initialize(id: nil, origin: nil, destination: nil, service_code: nil, pallets: [], structures: [], packages: [], options: {}) ⇒ Shipment
Returns a new instance of Shipment.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/physical/shipment.rb', line 14 def initialize(id: nil, origin: nil, destination: nil, service_code: nil, pallets: [], structures: [], packages: [], options: {}) @id = id || SecureRandom.uuid @origin = origin @destination = destination @service_code = service_code @structures = structures @packages = packages @options = return unless pallets.any? warn "[DEPRECATION] `pallets` is deprecated. Please use `structures` instead." @pallets = pallets end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
5 6 7 |
# File 'lib/physical/shipment.rb', line 5 def destination @destination end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/physical/shipment.rb', line 5 def id @id end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/physical/shipment.rb', line 5 def @options end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
5 6 7 |
# File 'lib/physical/shipment.rb', line 5 def origin @origin end |
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
5 6 7 |
# File 'lib/physical/shipment.rb', line 5 def packages @packages end |
#pallets ⇒ Object (readonly)
Returns the value of attribute pallets.
5 6 7 |
# File 'lib/physical/shipment.rb', line 5 def pallets @pallets end |
#service_code ⇒ Object (readonly)
Returns the value of attribute service_code.
5 6 7 |
# File 'lib/physical/shipment.rb', line 5 def service_code @service_code end |
#structures ⇒ Object (readonly)
Returns the value of attribute structures.
5 6 7 |
# File 'lib/physical/shipment.rb', line 5 def structures @structures end |