Class: FriendlyShipping::Services::RL::ItemOptions

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

Overview

Serializes items for R+L API requests.

Instance Attribute Summary collapse

Attributes inherited from ItemOptions

#item_id

Instance Method Summary collapse

Constructor Details

#initialize(freight_class: nil, nmfc_primary_code: nil, nmfc_sub_code: nil, **kwargs) ⇒ ItemOptions

Returns a new instance of ItemOptions.

Parameters:

  • freight_class (String) (defaults to: nil)

    the freight class

  • nmfc_primary_code (String) (defaults to: nil)

    the NMFC primary code

  • nmfc_sub_code (String) (defaults to: nil)

    the NMFC sub code

  • kwargs (Hash)

Options Hash (**kwargs):

  • :item_id (String)

    the ID for the item that belongs to these options



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/friendly_shipping/services/rl/item_options.rb', line 22

def initialize(
  freight_class: nil,
  nmfc_primary_code: nil,
  nmfc_sub_code: nil,
  **kwargs
)
  @freight_class = freight_class
  @nmfc_primary_code = nmfc_primary_code
  @nmfc_sub_code = nmfc_sub_code
  super(**kwargs)
end

Instance Attribute Details

#freight_classString (readonly)

Returns the freight class.

Returns:

  • (String)

    the freight class



9
10
11
# File 'lib/friendly_shipping/services/rl/item_options.rb', line 9

def freight_class
  @freight_class
end

#nmfc_primary_codeString (readonly)

Returns the NMFC primary code.

Returns:

  • (String)

    the NMFC primary code



12
13
14
# File 'lib/friendly_shipping/services/rl/item_options.rb', line 12

def nmfc_primary_code
  @nmfc_primary_code
end

#nmfc_sub_codeString (readonly)

Returns the NMFC sub code.

Returns:

  • (String)

    the NMFC sub code



15
16
17
# File 'lib/friendly_shipping/services/rl/item_options.rb', line 15

def nmfc_sub_code
  @nmfc_sub_code
end