Class: FriendlyShipping::Services::UpsFreight::GenerateCommodityInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/friendly_shipping/services/ups_freight/generate_commodity_information.rb

Class Method Summary collapse

Class Method Details

.call(shipment:, options:) ⇒ Array<Hash>

Parameters:

  • shipment (Physical::Shipment)
  • options (#options_for_package, #options_for_structure)

Returns:

  • (Array<Hash>)


11
12
13
14
15
16
17
18
# File 'lib/friendly_shipping/services/ups_freight/generate_commodity_information.rb', line 11

def call(shipment:, options:)
  if shipment.packages.any?
    warn "[DEPRECATION] `packages` is deprecated.  Please use `structures` instead."
    serialize_packages(shipment.packages, options)
  else
    serialize_structures(shipment.structures, options)
  end
end