Class: FriendlyShipping::Services::UpsFreight::LabelOptions

Inherits:
RatesOptions show all
Defined in:
lib/friendly_shipping/services/ups_freight/label_options.rb

Constant Summary collapse

REFERENCE_NUMBER_CODES =
{
  bill_of_lading_number: "57",
  purchase_order_number: "28",
  shipper_reference: "SH",
  consignee_reference: "CO",
  pm: "PM",
  proj: "PROJ",
  quote: "QUOTE",
  sid: "SID",
  task: "TASK",
  vprc: "VPRC",
  other: "OTHER"
}.freeze

Constants inherited from RatesOptions

RatesOptions::BILLING_CODES

Instance Attribute Summary collapse

Attributes inherited from RatesOptions

#billing_address, #billing_code, #commodity_information_generator, #customer_context, #customer_context A reference to match this request with an order or shipment, #pickup_comments Additional pickup instructions, #pickup_request_options, #shipper_number, #shipper_number The shipper number associated with the shipper, #shipping_method, #shipping_method The shipping method to use

Instance Method Summary collapse

Methods inherited from RatesOptions

#billing One of the keys in the `BILLING_CODES` constant. How the shipment=, #billing_address The billing address=, #commodity_information_generator A callable that takes a shipment=, #package_options Options for each of the packages/pallets in this shipment=, #pickup_date Date of the Pickup=

Methods inherited from FriendlyShipping::ShipmentOptions

#options_for_package

Constructor Details

#initialize(document_options: [], email_options: [], pickup_options: nil, delivery_options: nil, pickup_instructions: nil, delivery_instructions: nil, handling_instructions: nil, reference_numbers: [], **kwargs) ⇒ LabelOptions

Returns a new instance of LabelOptions.

Parameters:

  • reference_numbers (Array) (defaults to: [])

    Reference numbers for the Bill of Lading



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 31

def initialize(
  document_options: [],
  email_options: [],
  pickup_options: nil,
  delivery_options: nil,
  pickup_instructions: nil,
  delivery_instructions: nil,
  handling_instructions: nil,
  reference_numbers: [],
  **kwargs
)
  @pickup_options = pickup_options
  @delivery_options = delivery_options
  @document_options = document_options
  @email_options = email_options
  @pickup_instructions = pickup_instructions
  @delivery_instructions = delivery_instructions
  @handling_instructions = handling_instructions
  @reference_numbers = fill_codes(reference_numbers)
  super(**kwargs)
end

Instance Attribute Details

#delivery_instructionsObject (readonly)

Returns the value of attribute delivery_instructions.



21
22
23
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 21

def delivery_instructions
  @delivery_instructions
end

#delivery_optionsObject (readonly)

Returns the value of attribute delivery_options.



21
22
23
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 21

def delivery_options
  @delivery_options
end

#document_optionsObject (readonly)

Returns the value of attribute document_options.



21
22
23
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 21

def document_options
  @document_options
end

#email_optionsObject (readonly)

Returns the value of attribute email_options.



21
22
23
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 21

def email_options
  @email_options
end

#handling_instructionsObject (readonly)

Returns the value of attribute handling_instructions.



21
22
23
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 21

def handling_instructions
  @handling_instructions
end

#pickup_instructionsObject (readonly)

Returns the value of attribute pickup_instructions.



21
22
23
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 21

def pickup_instructions
  @pickup_instructions
end

#pickup_optionsObject (readonly)

Returns the value of attribute pickup_options.



21
22
23
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 21

def pickup_options
  @pickup_options
end

#reference_numbersObject (readonly)

Returns the value of attribute reference_numbers.



21
22
23
# File 'lib/friendly_shipping/services/ups_freight/label_options.rb', line 21

def reference_numbers
  @reference_numbers
end