Class: FriendlyShipping::Services::ShipEngine::RatesItemOptions

Inherits:
ItemOptions
  • Object
show all
Defined in:
lib/friendly_shipping/services/ship_engine/rates_item_options.rb

Overview

Options for each item passed in the rates API call.

Instance Attribute Summary collapse

Attributes inherited from ItemOptions

#item_id

Instance Method Summary collapse

Constructor Details

#initialize(commodity_code: nil, country_of_origin: nil, **kwargs) ⇒ RatesItemOptions

Returns a new instance of RatesItemOptions.

Parameters:

  • commodity_code (String) (defaults to: nil)

    the HS or NMFC code for international shipments

  • country_of_origin (String) (defaults to: nil)

    the country of origin for international shipments

  • kwargs (Hash)

Options Hash (**kwargs):

  • :item_id (String)

    the ID for the item that belongs to these options



18
19
20
21
22
# File 'lib/friendly_shipping/services/ship_engine/rates_item_options.rb', line 18

def initialize(commodity_code: nil, country_of_origin: nil, **kwargs)
  @commodity_code = commodity_code
  @country_of_origin = country_of_origin
  super(**kwargs)
end

Instance Attribute Details

#commodity_codeString (readonly)

Returns the HS or NMFC code for international shipments.

Returns:

  • (String)

    the HS or NMFC code for international shipments



9
10
11
# File 'lib/friendly_shipping/services/ship_engine/rates_item_options.rb', line 9

def commodity_code
  @commodity_code
end

#country_of_originString (readonly)

Returns the country of origin for international shipments.

Returns:

  • (String)

    the country of origin for international shipments



12
13
14
# File 'lib/friendly_shipping/services/ship_engine/rates_item_options.rb', line 12

def country_of_origin
  @country_of_origin
end