Class: FriendlyShipping::Services::ShipEngine::RatesPackageOptions

Inherits:
PackageOptions
  • Object
show all
Defined in:
lib/friendly_shipping/services/ship_engine/rates_package_options.rb

Overview

Options for each package passed in the rates API call.

Instance Attribute Summary

Attributes inherited from PackageOptions

#package_id

Instance Method Summary collapse

Methods inherited from PackageOptions

#options_for_item

Constructor Details

#initialize(**kwargs) ⇒ RatesPackageOptions

Returns a new instance of RatesPackageOptions.

Parameters:

  • 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



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

def initialize(**kwargs)
  super(**kwargs.reverse_merge(item_options_class: RatesItemOptions))
end