Class: FriendlyShipping::Services::ShipEngineLTL::QuoteOptions

Inherits:
FriendlyShipping::ShipmentOptions show all
Defined in:
lib/friendly_shipping/services/ship_engine_ltl/quote_options.rb

Overview

Options for rate quote requests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from FriendlyShipping::ShipmentOptions

#options_for_package

Constructor Details

#initialize(service_code: nil, pickup_date: nil, accessorial_service_codes: [], structures_serializer_class: SerializeStructures, packages_serializer_class: SerializePackages, **kwargs) ⇒ QuoteOptions

Returns a new instance of QuoteOptions.

Parameters:

  • service_code (String) (defaults to: nil)

    the service code to use when getting rates

  • pickup_date (Time) (defaults to: nil)

    the pickup date

  • accessorial_service_codes (Array<String>) (defaults to: [])

    the accessorial service codes (if any)

  • packages_serializer_class (Class) (defaults to: SerializePackages)

    the class to use for serializing packages (DEPRECATED: use structures_serializer_class instead)

  • structures_serializer_class (Class) (defaults to: SerializeStructures)

    the class to use for serializing structures

  • kwargs (Hash)

Options Hash (**kwargs):

  • :package_options (Array<PackageOptions>)

    the options for packages in this shipment (DEPRECATED: use structure_options instead)

  • :package_options_class (Class)

    the class to use for package options when none are provided (DEPRECATED: use structure_options_class instead)

  • :structure_options (Array<StructureOptions>)

    the options for structures in this shipment

  • :structure_options_class (Class)

    the class to use for structure options when none are provided



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/friendly_shipping/services/ship_engine_ltl/quote_options.rb', line 34

def initialize(
  service_code: nil,
  pickup_date: nil,
  accessorial_service_codes: [],
  structures_serializer_class: SerializeStructures,
  packages_serializer_class: SerializePackages,
  **kwargs
)
  @service_code = service_code
  @pickup_date = pickup_date
  @accessorial_service_codes = accessorial_service_codes
  @structures_serializer_class = structures_serializer_class
  @packages_serializer_class = packages_serializer_class
  super(**kwargs)
end

Instance Attribute Details

#accessorial_service_codesArray<String> (readonly)

Returns the accessorial service codes.

Returns:

  • (Array<String>)

    the accessorial service codes



15
16
17
# File 'lib/friendly_shipping/services/ship_engine_ltl/quote_options.rb', line 15

def accessorial_service_codes
  @accessorial_service_codes
end

#packages_serializer_classClass (readonly)

Deprecated.

Returns the class to use for serializing packages.

Returns:

  • (Class)

    the class to use for serializing packages



22
23
24
# File 'lib/friendly_shipping/services/ship_engine_ltl/quote_options.rb', line 22

def packages_serializer_class
  @packages_serializer_class
end

#pickup_dateTime (readonly)

Returns the pickup date.

Returns:

  • (Time)

    the pickup date



12
13
14
# File 'lib/friendly_shipping/services/ship_engine_ltl/quote_options.rb', line 12

def pickup_date
  @pickup_date
end

#service_codeString (readonly)

Returns the service code to use when getting rates.

Returns:

  • (String)

    the service code to use when getting rates



9
10
11
# File 'lib/friendly_shipping/services/ship_engine_ltl/quote_options.rb', line 9

def service_code
  @service_code
end

#structures_serializer_classClass (readonly)

Returns the class to use for serializing structures.

Returns:

  • (Class)

    the class to use for serializing structures



18
19
20
# File 'lib/friendly_shipping/services/ship_engine_ltl/quote_options.rb', line 18

def structures_serializer_class
  @structures_serializer_class
end