Class: FriendlyShipping::Services::ShipEngineLTL::PackageOptions

Inherits:
PackageOptions
  • Object
show all
Defined in:
lib/friendly_shipping/services/ship_engine_ltl/package_options.rb

Overview

Package options for rate quotes.

Instance Attribute Summary collapse

Attributes inherited from PackageOptions

#package_id

Instance Method Summary collapse

Methods inherited from PackageOptions

#options_for_item

Constructor Details

#initialize(packaging_code: nil, freight_class: nil, nmfc_code: nil, stackable: true, hazardous_materials: false, **kwargs) ⇒ PackageOptions

Returns a new instance of PackageOptions.

Parameters:

  • packaging_code (String) (defaults to: nil)
  • freight_class (String) (defaults to: nil)
  • nmfc_code (String) (defaults to: nil)
  • stackable (Boolean) (defaults to: true)
  • hazardous_materials (Boolean) (defaults to: false)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :package_id (String)

    the ID for the package that belongs to these options

  • :item_options (Array<ItemOptions>)

    the options for items in this package

  • :item_options_class (Class)

    the class to use for item options when none are provided



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

def initialize(
  packaging_code: nil,
  freight_class: nil,
  nmfc_code: nil,
  stackable: true,
  hazardous_materials: false,
  **kwargs
)
  @packaging_code = packaging_code
  @freight_class = freight_class
  @nmfc_code = nmfc_code
  @stackable = stackable
  @hazardous_materials = hazardous_materials
  super(**kwargs.reverse_merge(item_options_class: ItemOptions))
end

Instance Attribute Details

#freight_classString (readonly)

Returns:

  • (String)


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

def freight_class
  @freight_class
end

#hazardous_materialsBoolean (readonly)

Returns:

  • (Boolean)


21
22
23
# File 'lib/friendly_shipping/services/ship_engine_ltl/package_options.rb', line 21

def hazardous_materials
  @hazardous_materials
end

#nmfc_codeString (readonly)

Returns:

  • (String)


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

def nmfc_code
  @nmfc_code
end

#packaging_codeString (readonly)

Returns:

  • (String)


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

def packaging_code
  @packaging_code
end

#stackableBoolean (readonly)

Returns:

  • (Boolean)


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

def stackable
  @stackable
end