Class: FriendlyShipping::Services::UpsFreight::RatesStructureOptions
- Inherits:
-
FriendlyShipping::StructureOptions
- Object
- FriendlyShipping::StructureOptions
- FriendlyShipping::Services::UpsFreight::RatesStructureOptions
- Defined in:
- lib/friendly_shipping/services/ups_freight/rates_structure_options.rb
Overview
Options for structures/pallets within a UPS Freight shipment.
Direct Known Subclasses
Constant Summary collapse
- 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
- #handling_unit_code ⇒ String readonly
- #handling_unit_description ⇒ String readonly
- #handling_unit_tag ⇒ String readonly
Attributes inherited from FriendlyShipping::StructureOptions
Instance Method Summary collapse
-
#initialize(handling_unit: :pallet, **kwargs) ⇒ RatesStructureOptions
constructor
A new instance of RatesStructureOptions.
Methods inherited from FriendlyShipping::StructureOptions
Constructor Details
#initialize(handling_unit: :pallet, **kwargs) ⇒ RatesStructureOptions
Returns a new instance of RatesStructureOptions.
32 33 34 35 36 37 38 39 40 |
# File 'lib/friendly_shipping/services/ups_freight/rates_structure_options.rb', line 32 def initialize( handling_unit: :pallet, **kwargs ) @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(package_options_class: RatesPackageOptions)) end |
Instance Attribute Details
#handling_unit_code ⇒ String (readonly)
25 26 27 |
# File 'lib/friendly_shipping/services/ups_freight/rates_structure_options.rb', line 25 def handling_unit_code @handling_unit_code end |
#handling_unit_description ⇒ String (readonly)
19 20 21 |
# File 'lib/friendly_shipping/services/ups_freight/rates_structure_options.rb', line 19 def handling_unit_description @handling_unit_description end |
#handling_unit_tag ⇒ String (readonly)
22 23 24 |
# File 'lib/friendly_shipping/services/ups_freight/rates_structure_options.rb', line 22 def handling_unit_tag @handling_unit_tag end |