Class: FriendlyShipping::Services::Ups::RateEstimateOptions
- Inherits:
-
FriendlyShipping::ShipmentOptions
- Object
- FriendlyShipping::ShipmentOptions
- FriendlyShipping::Services::Ups::RateEstimateOptions
- Defined in:
- lib/friendly_shipping/services/ups/rate_estimate_options.rb
Constant Summary collapse
- PICKUP_TYPE_CODES =
{ daily_pickup: "01", customer_counter: "03", one_time_pickup: "06", on_call_air: "07", suggested_retail_rates: "11", letter_center: "19", air_service_center: "20" }.freeze
- CUSTOMER_CLASSIFICATION_CODES =
{ shipper_number: "00", daily_rates: "01", retail_rates: "04", regional_rates: "05", general_rates: "06", standard_rates: "53" }.freeze
- SUB_VERSIONS =
%w[1601 1607 1701 1707 1801 2108 2201 2205].freeze
Instance Attribute Summary collapse
-
#carbon_neutral ⇒ Object
readonly
Returns the value of attribute carbon_neutral.
-
#customer_context ⇒ Object
readonly
Returns the value of attribute customer_context.
-
#destination_account ⇒ Object
readonly
Returns the value of attribute destination_account.
-
#negotiated_rates ⇒ Object
readonly
Returns the value of attribute negotiated_rates.
-
#pickup_date ⇒ Object
readonly
Returns the value of attribute pickup_date.
-
#saturday_delivery ⇒ Object
readonly
Returns the value of attribute saturday_delivery.
-
#saturday_pickup ⇒ Object
readonly
Returns the value of attribute saturday_pickup.
-
#shipper ⇒ Object
readonly
Returns the value of attribute shipper.
-
#shipper_number ⇒ Object
readonly
Returns the value of attribute shipper_number.
-
#shipping_method ⇒ Object
readonly
Returns the value of attribute shipping_method.
-
#sub_version ⇒ Object
readonly
Returns the value of attribute sub_version.
-
#with_time_in_transit ⇒ Object
readonly
Returns the value of attribute with_time_in_transit.
Instance Method Summary collapse
- #customer_classification_code ⇒ Object
-
#initialize(shipper_number:, carbon_neutral: true, customer_context: nil, customer_classification: :daily_rates, destination_account: nil, negotiated_rates: false, pickup_type: :daily_pickup, pickup_date: nil, saturday_delivery: false, saturday_pickup: false, shipper: nil, shipping_method: nil, sub_version: "1707", with_time_in_transit: false, package_options_class: FriendlyShipping::Services::Ups::RateEstimatePackageOptions, **kwargs) ⇒ RateEstimateOptions
constructor
A new instance of RateEstimateOptions.
- #pickup_type_code ⇒ Object
Methods inherited from FriendlyShipping::ShipmentOptions
Constructor Details
#initialize(shipper_number:, carbon_neutral: true, customer_context: nil, customer_classification: :daily_rates, destination_account: nil, negotiated_rates: false, pickup_type: :daily_pickup, pickup_date: nil, saturday_delivery: false, saturday_pickup: false, shipper: nil, shipping_method: nil, sub_version: "1707", with_time_in_transit: false, package_options_class: FriendlyShipping::Services::Ups::RateEstimatePackageOptions, **kwargs) ⇒ RateEstimateOptions
Returns a new instance of RateEstimateOptions.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 66 def initialize( shipper_number:, carbon_neutral: true, customer_context: nil, customer_classification: :daily_rates, destination_account: nil, negotiated_rates: false, pickup_type: :daily_pickup, pickup_date: nil, saturday_delivery: false, saturday_pickup: false, shipper: nil, shipping_method: nil, sub_version: "1707", with_time_in_transit: false, package_options_class: FriendlyShipping::Services::Ups::RateEstimatePackageOptions, **kwargs ) raise ArgumentError, "Invalid sub-version: #{sub_version}" unless sub_version.in?(SUB_VERSIONS) @carbon_neutral = carbon_neutral @customer_context = customer_context @customer_classification = customer_classification @destination_account = destination_account @negotiated_rates = negotiated_rates @shipper_number = shipper_number @pickup_type = pickup_type @pickup_date = pickup_date @saturday_delivery = saturday_delivery @saturday_pickup = saturday_pickup @shipper = shipper @shipping_method = shipping_method @sub_version = sub_version @with_time_in_transit = with_time_in_transit super(**kwargs.reverse_merge(package_options_class: )) end |
Instance Attribute Details
#carbon_neutral ⇒ Object (readonly)
Returns the value of attribute carbon_neutral.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def carbon_neutral @carbon_neutral end |
#customer_context ⇒ Object (readonly)
Returns the value of attribute customer_context.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def customer_context @customer_context end |
#destination_account ⇒ Object (readonly)
Returns the value of attribute destination_account.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def destination_account @destination_account end |
#negotiated_rates ⇒ Object (readonly)
Returns the value of attribute negotiated_rates.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def negotiated_rates @negotiated_rates end |
#pickup_date ⇒ Object (readonly)
Returns the value of attribute pickup_date.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def pickup_date @pickup_date end |
#saturday_delivery ⇒ Object (readonly)
Returns the value of attribute saturday_delivery.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def saturday_delivery @saturday_delivery end |
#saturday_pickup ⇒ Object (readonly)
Returns the value of attribute saturday_pickup.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def saturday_pickup @saturday_pickup end |
#shipper ⇒ Object (readonly)
Returns the value of attribute shipper.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def shipper @shipper end |
#shipper_number ⇒ Object (readonly)
Returns the value of attribute shipper_number.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def shipper_number @shipper_number end |
#shipping_method ⇒ Object (readonly)
Returns the value of attribute shipping_method.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def shipping_method @shipping_method end |
#sub_version ⇒ Object (readonly)
Returns the value of attribute sub_version.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def sub_version @sub_version end |
#with_time_in_transit ⇒ Object (readonly)
Returns the value of attribute with_time_in_transit.
53 54 55 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 53 def with_time_in_transit @with_time_in_transit end |
Instance Method Details
#customer_classification_code ⇒ Object
107 108 109 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 107 def customer_classification_code CUSTOMER_CLASSIFICATION_CODES[@customer_classification] end |
#pickup_type_code ⇒ Object
103 104 105 |
# File 'lib/friendly_shipping/services/ups/rate_estimate_options.rb', line 103 def pickup_type_code PICKUP_TYPE_CODES[@pickup_type] end |