Class: FriendlyShipping::Services::RL::SerializeTransitTimesRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/friendly_shipping/services/rl/serialize_transit_times_request.rb

Overview

Serializes an R+L API request to get a shipment transit timing estimate.

Class Method Summary collapse

Class Method Details

.call(shipment:, options:) ⇒ Hash

Returns the serialized request.

Parameters:

  • shipment (Physical::Shipment)

    the shipment for the request

  • options (RateQuoteOptions)

    options for the request

Returns:

  • (Hash)

    the serialized request



12
13
14
15
16
17
18
19
20
# File 'lib/friendly_shipping/services/rl/serialize_transit_times_request.rb', line 12

def call(shipment:, options:)
  {
    PickupDate: options.pickup_date.strftime('%m/%d/%Y'),
    Origin: serialize_location(shipment.origin),
    Destinations: [
      serialize_location(shipment.destination)
    ]
  }.compact
end