Class: FriendlyShipping::Services::TForceFreight::GeneratePickupRequestHash

Inherits:
Object
  • Object
show all
Defined in:
lib/friendly_shipping/services/tforce_freight/generate_pickup_request_hash.rb

Overview

Generates a pickup request hash for JSON serialization.

Class Method Summary collapse

Class Method Details

.call(shipment:, options:) ⇒ Hash

Returns pickup request hash.

Parameters:

  • shipment (Physical::Shipment)

    the shipment for which we want to create a pickup request

  • options (PickupOptions)

    options for the pickup request

Returns:

  • (Hash)

    pickup request hash



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/friendly_shipping/services/tforce_freight/generate_pickup_request_hash.rb', line 12

def call(shipment:, options:)
  {
    pickup: pickup(options),
    requester: requester(shipment.origin),
    origin: origin(shipment.origin),
    destination: destination(shipment.destination),
    services: options.service_options,
    lineItems: line_items(shipment.packages, options),
    instructions: instructions(options),
    pomIndicator: false # We don't support this yet
  }.compact
end