Sha256: f678ed426f72545cb22760a1846a182a0c4e9d8e6c5df2ffea8cdc9832cf5e82

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

require 'friendly_shipping/services/usps/rate_estimate_package_options'

module FriendlyShipping
  module Services
    # Option container for rating a shipment via USPS
    #
    # Context: The shipment object we're trying to get results for
    # USPS returns rates on a package-by-package basis, so the options for obtaining rates are
    # set on the [FriendlyShipping/RateEstimateObject] hash. The possible options are:

    # @param [Physical::ShippingMethod] shipping_method The shipping method ("service" in USPS parlance) we want
    #   to get rates for.
    # @param [Boolean] commercial_pricing Whether we prefer commercial pricing results or retail results
    # @param [Boolean] hold_for_pickup Whether we want a rate with Hold For Pickup Service
    class Usps
      class RateEstimateOptions < FriendlyShipping::ShipmentOptions
        def initialize(
          package_options_class: FriendlyShipping::Services::Usps::RateEstimatePackageOptions,
          **kwargs
        )
          super(**kwargs.merge(package_options_class: package_options_class))
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
friendly_shipping-0.8.1 lib/friendly_shipping/services/usps/rate_estimate_options.rb
friendly_shipping-0.8.0 lib/friendly_shipping/services/usps/rate_estimate_options.rb
friendly_shipping-0.7.3 lib/friendly_shipping/services/usps/rate_estimate_options.rb
friendly_shipping-0.7.2 lib/friendly_shipping/services/usps/rate_estimate_options.rb
friendly_shipping-0.7.1 lib/friendly_shipping/services/usps/rate_estimate_options.rb
friendly_shipping-0.7.0 lib/friendly_shipping/services/usps/rate_estimate_options.rb