Class: FriendlyShipping::Services::UpsFreight::RatesOptions
- Inherits:
-
FriendlyShipping::ShipmentOptions
- Object
- FriendlyShipping::ShipmentOptions
- FriendlyShipping::Services::UpsFreight::RatesOptions
- Defined in:
- lib/friendly_shipping/services/ups_freight/rates_options.rb
Overview
Options for generating UPS Freight rates for a shipment
Direct Known Subclasses
Constant Summary collapse
- BILLING_CODES =
{ prepaid: '10', third_party: '30', freight_collect: '40' }.freeze
Instance Attribute Summary collapse
- #billing_address ⇒ Physical::Location readonly
- #billing_code ⇒ Symbol readonly
- #commodity_information_generator ⇒ Callable readonly
- #customer_context ⇒ String readonly
- #pickup_request_options ⇒ PickupRequestOptions readonly
- #shipper_number ⇒ String readonly
- #shipping_method ⇒ FriendlyShipping::ShippingMethod readonly
Instance Method Summary collapse
-
#initialize(shipper_number:, billing_address:, shipping_method:, billing: :prepaid, customer_context: nil, pickup_request_options: nil, commodity_information_generator: GenerateCommodityInformation, **kwargs) ⇒ RatesOptions
constructor
A new instance of RatesOptions.
Methods inherited from FriendlyShipping::ShipmentOptions
Constructor Details
#initialize(shipper_number:, billing_address:, shipping_method:, billing: :prepaid, customer_context: nil, pickup_request_options: nil, commodity_information_generator: GenerateCommodityInformation, **kwargs) ⇒ RatesOptions
Returns a new instance of RatesOptions.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/friendly_shipping/services/ups_freight/rates_options.rb', line 43 def initialize( shipper_number:, billing_address:, shipping_method:, billing: :prepaid, customer_context: nil, pickup_request_options: nil, commodity_information_generator: GenerateCommodityInformation, **kwargs ) @shipper_number = shipper_number @billing_address = billing_address @shipping_method = shipping_method @billing_code = BILLING_CODES.fetch(billing) @customer_context = customer_context @pickup_request_options = @commodity_information_generator = commodity_information_generator super(**kwargs.reverse_merge(package_options_class: RatesPackageOptions)) end |
Instance Attribute Details
#billing_address ⇒ Physical::Location (readonly)
18 19 20 |
# File 'lib/friendly_shipping/services/ups_freight/rates_options.rb', line 18 def billing_address @billing_address end |
#billing_code ⇒ Symbol (readonly)
21 22 23 |
# File 'lib/friendly_shipping/services/ups_freight/rates_options.rb', line 21 def billing_code @billing_code end |
#commodity_information_generator ⇒ Callable (readonly)
33 34 35 |
# File 'lib/friendly_shipping/services/ups_freight/rates_options.rb', line 33 def commodity_information_generator @commodity_information_generator end |
#customer_context ⇒ String (readonly)
24 25 26 |
# File 'lib/friendly_shipping/services/ups_freight/rates_options.rb', line 24 def customer_context @customer_context end |
#pickup_request_options ⇒ PickupRequestOptions (readonly)
30 31 32 |
# File 'lib/friendly_shipping/services/ups_freight/rates_options.rb', line 30 def @pickup_request_options end |
#shipper_number ⇒ String (readonly)
15 16 17 |
# File 'lib/friendly_shipping/services/ups_freight/rates_options.rb', line 15 def shipper_number @shipper_number end |
#shipping_method ⇒ FriendlyShipping::ShippingMethod (readonly)
27 28 29 |
# File 'lib/friendly_shipping/services/ups_freight/rates_options.rb', line 27 def shipping_method @shipping_method end |