Class: FriendlyShipping::Services::TForceFreight::GenerateCommodityInformation
- Inherits:
-
Object
- Object
- FriendlyShipping::Services::TForceFreight::GenerateCommodityInformation
- Defined in:
- lib/friendly_shipping/services/tforce_freight/generate_commodity_information.rb
Overview
Generates a commodity information hash for JSON serialization.
Class Method Summary collapse
-
.call(shipment:, options:) ⇒ Array<Hash>
Commodities hash suitable for JSON request.
Class Method Details
.call(shipment:, options:) ⇒ Array<Hash>
Returns commodities hash suitable for JSON request.
12 13 14 15 16 17 18 19 |
# File 'lib/friendly_shipping/services/tforce_freight/generate_commodity_information.rb', line 12 def call(shipment:, options:) if shipment.structures.any? serialize_structures(shipment.structures, ) else warn "[DEPRECATION] `packages` is deprecated. Please use `structures` instead." serialize_packages(shipment.packages, ) end end |