Class: FriendlyShipping::Services::UpsFreight::RatesPackageOptions
- Inherits:
-
PackageOptions
- Object
- PackageOptions
- FriendlyShipping::Services::UpsFreight::RatesPackageOptions
- Defined in:
- lib/friendly_shipping/services/ups_freight/rates_package_options.rb
Overview
Options for packages/pallets within a UPS Freight shipment.
Direct Known Subclasses
Constant Summary collapse
- PACKAGING_TYPES =
Maps friendly names to packaging types.
{ bag: { code: "BAG", description: "Bag" }, bale: { code: "BAL", description: "Bale" }, barrel: { code: "BAR", description: "Barrel" }, bundle: { code: "BDL", description: "Bundle" }, bin: { code: "BIN", description: "Bin" }, box: { code: "BOX", description: "Box" }, basket: { code: "BSK", description: "Basket" }, bunch: { code: "BUN", description: "Bunch" }, cabinet: { code: "CAB", description: "Cabinet" }, can: { code: "CAN", description: "Can" }, carrier: { code: "CAR", description: "Carrier" }, case: { code: "CAS", description: "Case" }, carboy: { code: "CBY", description: "Carboy" }, container: { code: "CON", description: "Container" }, crate: { code: "CRT", description: "Crate" }, cask: { code: "CSK", description: "Cask" }, carton: { code: "CTN", description: "Carton" }, cylinder: { code: "CYL", description: "Cylinder" }, drum: { code: "DRM", description: "Drum" }, loose: { code: "LOO", description: "Loose" }, other: { code: "OTH", description: "Other" }, pail: { code: "PAL", description: "Pail" }, pieces: { code: "PCS", description: "Pieces" }, package: { code: "PKG", description: "Package" }, pipe_line: { code: "PLN", description: "Pipe Line" }, pallet: { code: "PLT", description: "Pallet" }, rack: { code: "RCK", description: "Rack" }, reel: { code: "REL", description: "Reel" }, roll: { code: "ROL", description: "Roll" }, skid: { code: "SKD", description: "Skid" }, spool: { code: "SPL", description: "Spool" }, tube: { code: "TBE", description: "Tube" }, tank: { code: "TNK", description: "Tank" }, totes: { code: "TOT", description: "Totes" }, unit: { code: "UNT", description: "Unit" }, van_pack: { code: "VPK", description: "Van Pack" }, wrapped: { code: "WRP", description: "Wrapped" } }.freeze
- HANDLING_UNIT_TYPES =
Maps friendly names to handling unit types.
{ pallet: { code: "PLT", description: "Pallet", handling_unit_tag: 'One' }, skid: { code: "SKD", description: "Skid", handling_unit_tag: 'One' }, carboy: { code: "CBY", description: "Carboy", handling_unit_tag: 'One' }, totes: { code: "TOT", description: "Totes", handling_unit_tag: 'One' }, other: { code: "OTH", description: "Other", handling_unit_tag: 'Two' }, loose: { code: "LOO", description: "Loose", handling_unit_tag: 'Two' } }.freeze
Instance Attribute Summary collapse
- #freight_class ⇒ String readonly
- #handling_unit_code ⇒ String readonly
- #handling_unit_description ⇒ String readonly
- #handling_unit_tag ⇒ String readonly
- #nmfc_code ⇒ String readonly
- #packaging_code ⇒ String readonly
- #packaging_description ⇒ String readonly
Attributes inherited from PackageOptions
Instance Method Summary collapse
-
#initialize(packaging: :carton, freight_class: nil, nmfc_code: nil, handling_unit: :pallet, **kwargs) ⇒ RatesPackageOptions
constructor
A new instance of RatesPackageOptions.
Methods inherited from PackageOptions
Constructor Details
#initialize(packaging: :carton, freight_class: nil, nmfc_code: nil, handling_unit: :pallet, **kwargs) ⇒ RatesPackageOptions
Returns a new instance of RatesPackageOptions.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/friendly_shipping/services/ups_freight/rates_package_options.rb', line 88 def initialize( packaging: :carton, freight_class: nil, nmfc_code: nil, handling_unit: :pallet, **kwargs ) @packaging_code = PACKAGING_TYPES.fetch(packaging).fetch(:code) @packaging_description = PACKAGING_TYPES.fetch(packaging).fetch(:description) @freight_class = freight_class @nmfc_code = nmfc_code @handling_unit_code = HANDLING_UNIT_TYPES.fetch(handling_unit).fetch(:code) @handling_unit_description = HANDLING_UNIT_TYPES.fetch(handling_unit).fetch(:description) @handling_unit_tag = "HandlingUnit#{HANDLING_UNIT_TYPES.fetch(handling_unit).fetch(:handling_unit_tag)}" super(**kwargs.reverse_merge(item_options_class: RatesItemOptions)) end |
Instance Attribute Details
#freight_class ⇒ String (readonly)
66 67 68 |
# File 'lib/friendly_shipping/services/ups_freight/rates_package_options.rb', line 66 def freight_class @freight_class end |
#handling_unit_code ⇒ String (readonly)
78 79 80 |
# File 'lib/friendly_shipping/services/ups_freight/rates_package_options.rb', line 78 def handling_unit_code @handling_unit_code end |
#handling_unit_description ⇒ String (readonly)
72 73 74 |
# File 'lib/friendly_shipping/services/ups_freight/rates_package_options.rb', line 72 def handling_unit_description @handling_unit_description end |
#handling_unit_tag ⇒ String (readonly)
75 76 77 |
# File 'lib/friendly_shipping/services/ups_freight/rates_package_options.rb', line 75 def handling_unit_tag @handling_unit_tag end |
#nmfc_code ⇒ String (readonly)
69 70 71 |
# File 'lib/friendly_shipping/services/ups_freight/rates_package_options.rb', line 69 def nmfc_code @nmfc_code end |
#packaging_code ⇒ String (readonly)
60 61 62 |
# File 'lib/friendly_shipping/services/ups_freight/rates_package_options.rb', line 60 def packaging_code @packaging_code end |
#packaging_description ⇒ String (readonly)
63 64 65 |
# File 'lib/friendly_shipping/services/ups_freight/rates_package_options.rb', line 63 def packaging_description @packaging_description end |