Class: FriendlyShipping::Services::TForceFreight::ShipmentInformation

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

Overview

Information for a specific shipment returned by the API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bol_id:, pro_number: nil, pickup_confirmation_number: nil, origin_service_center: nil, email_sent: nil, origin_is_rural: nil, destination_is_rural: nil, rates: [], total_charges: nil, billable_weight: nil, days_in_transit: nil, documents: [], shipping_method: nil, warnings: nil, data: {}) ⇒ ShipmentInformation

Returns a new instance of ShipmentInformation.

Parameters:

  • bol_id (String)

    the shipment's BOL ID number

  • pro_number (String) (defaults to: nil)

    the shipment's PRO number

  • pickup_confirmation_number (String) (defaults to: nil)

    the shipment's pickup confirmation number

  • origin_service_center (String) (defaults to: nil)

    the origin service center

  • email_sent (Boolean) (defaults to: nil)

    whether or not the email was sent

  • origin_is_rural (Boolean) (defaults to: nil)

    whether or not the origin is rural

  • destination_is_rural (Boolean) (defaults to: nil)

    whether or not the destination is rural

  • rates (Array<Hash>) (defaults to: [])

    the rates

  • total_charges (Money) (defaults to: nil)

    the total charges for this shipment

  • billable_weight (Measured::Weight) (defaults to: nil)

    the billable weight for this shipment

  • days_in_transit (Integer) (defaults to: nil)

    the number of days in transit

  • documents (Array<ShipmentDocument>) (defaults to: [])

    the shipment's documents (BOL, labels, etc)

  • shipping_method (ShippingMethod) (defaults to: nil)

    the shipping method

  • warnings (Array<String>) (defaults to: nil)

    any warnings

  • data (Hash) (defaults to: {})

    any additional data



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 68

def initialize(
  bol_id:,
  pro_number: nil,
  pickup_confirmation_number: nil,
  origin_service_center: nil,
  email_sent: nil,
  origin_is_rural: nil,
  destination_is_rural: nil,
  rates: [],
  total_charges: nil,
  billable_weight: nil,
  days_in_transit: nil,
  documents: [],
  shipping_method: nil,
  warnings: nil,
  data: {}
)
  @bol_id = bol_id
  @pro_number = pro_number
  @pickup_confirmation_number = pickup_confirmation_number
  @origin_service_center = origin_service_center
  @email_sent = email_sent
  @origin_is_rural = origin_is_rural
  @destination_is_rural = destination_is_rural
  @rates = rates
  @total_charges = total_charges
  @billable_weight = billable_weight
  @days_in_transit = days_in_transit
  @documents = documents
  @shipping_method = shipping_method
  @warnings = warnings
  @data = data
end

Instance Attribute Details

#billable_weightMeasured::Weight (readonly)

Returns the billable weight for this shipment.

Returns:

  • (Measured::Weight)

    the billable weight for this shipment



36
37
38
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 36

def billable_weight
  @billable_weight
end

#bol_idString (readonly)

Returns the shipment's BOL ID number.

Returns:

  • (String)

    the shipment's BOL ID number



9
10
11
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 9

def bol_id
  @bol_id
end

#dataHash (readonly)

Returns any additional data.

Returns:

  • (Hash)

    any additional data



51
52
53
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 51

def data
  @data
end

#days_in_transitInteger (readonly)

Returns the number of days in transit.

Returns:

  • (Integer)

    the number of days in transit



39
40
41
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 39

def days_in_transit
  @days_in_transit
end

#destination_is_ruralBoolean (readonly)

Returns whether or not the destination is rural.

Returns:

  • (Boolean)

    whether or not the destination is rural



27
28
29
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 27

def destination_is_rural
  @destination_is_rural
end

#documentsArray<ShipmentDocument> (readonly)

Returns the shipment's documents (BOL, labels, etc).

Returns:



42
43
44
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 42

def documents
  @documents
end

#email_sentBoolean (readonly)

Returns whether or not the email was sent.

Returns:

  • (Boolean)

    whether or not the email was sent



21
22
23
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 21

def email_sent
  @email_sent
end

#origin_is_ruralBoolean (readonly)

Returns whether or not the origin is rural.

Returns:

  • (Boolean)

    whether or not the origin is rural



24
25
26
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 24

def origin_is_rural
  @origin_is_rural
end

#origin_service_centerString (readonly)

Returns the origin service center.

Returns:

  • (String)

    the origin service center



18
19
20
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 18

def origin_service_center
  @origin_service_center
end

#pickup_confirmation_numberString (readonly)

Returns the shipment's pickup confirmation number.

Returns:

  • (String)

    the shipment's pickup confirmation number



15
16
17
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 15

def pickup_confirmation_number
  @pickup_confirmation_number
end

#pro_numberString (readonly)

Returns the shipment's PRO number.

Returns:

  • (String)

    the shipment's PRO number



12
13
14
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 12

def pro_number
  @pro_number
end

#ratesArray<Hash> (readonly)

Returns the rates.

Returns:

  • (Array<Hash>)

    the rates



30
31
32
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 30

def rates
  @rates
end

#shipping_methodShippingMethod (readonly)

Returns the shipping method.

Returns:



45
46
47
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 45

def shipping_method
  @shipping_method
end

#total_chargesMoney (readonly)

Returns the total charges for this shipment.

Returns:

  • (Money)

    the total charges for this shipment



33
34
35
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 33

def total_charges
  @total_charges
end

#warningsArray<String> (readonly)

Returns any warnings.

Returns:

  • (Array<String>)

    any warnings



48
49
50
# File 'lib/friendly_shipping/services/tforce_freight/shipment_information.rb', line 48

def warnings
  @warnings
end