Class: FriendlyShipping::Services::USPSShip::RateEstimateOptions
- Inherits:
-
FriendlyShipping::ShipmentOptions
- Object
- FriendlyShipping::ShipmentOptions
- FriendlyShipping::Services::USPSShip::RateEstimateOptions
- Defined in:
- lib/friendly_shipping/services/usps_ship/rate_estimate_options.rb
Constant Summary collapse
- DESTINATION_ENTRY_FACILITY_TYPES =
{ none: "NONE", destination_network_distribution_center: "DESTINATION_NETWORK_DISTRIBUTION_CENTER", destination_sectional_center_facility: "DESTINATION_SECTIONAL_CENTER_FACILITY", destination_delivery_unit: "DESTINATION_DELIVERY_UNIT", destination_service_hub: "DESTINATION_SERVICE_HUB" }.freeze
Instance Attribute Summary collapse
- #destination_entry_facility_type ⇒ String readonly
- #mailing_date ⇒ #strftime readonly
- #shipping_method ⇒ ShippingMethod readonly
Instance Method Summary collapse
-
#initialize(shipping_method:, destination_entry_facility_type: :none, mailing_date: Date.today, package_options_class: FriendlyShipping::Services::USPSShip::RateEstimatePackageOptions, **kwargs) ⇒ RateEstimateOptions
constructor
A new instance of RateEstimateOptions.
Methods inherited from FriendlyShipping::ShipmentOptions
Constructor Details
#initialize(shipping_method:, destination_entry_facility_type: :none, mailing_date: Date.today, package_options_class: FriendlyShipping::Services::USPSShip::RateEstimatePackageOptions, **kwargs) ⇒ RateEstimateOptions
Returns a new instance of RateEstimateOptions.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/friendly_shipping/services/usps_ship/rate_estimate_options.rb', line 30 def initialize( shipping_method:, destination_entry_facility_type: :none, mailing_date: Date.today, package_options_class: FriendlyShipping::Services::USPSShip::RateEstimatePackageOptions, **kwargs ) @shipping_method = shipping_method @destination_entry_facility_type = DESTINATION_ENTRY_FACILITY_TYPES.fetch(destination_entry_facility_type) @mailing_date = mailing_date super(**kwargs.reverse_merge(package_options_class: )) end |
Instance Attribute Details
#destination_entry_facility_type ⇒ String (readonly)
19 20 21 |
# File 'lib/friendly_shipping/services/usps_ship/rate_estimate_options.rb', line 19 def destination_entry_facility_type @destination_entry_facility_type end |
#mailing_date ⇒ #strftime (readonly)
22 23 24 |
# File 'lib/friendly_shipping/services/usps_ship/rate_estimate_options.rb', line 22 def mailing_date @mailing_date end |
#shipping_method ⇒ ShippingMethod (readonly)
16 17 18 |
# File 'lib/friendly_shipping/services/usps_ship/rate_estimate_options.rb', line 16 def shipping_method @shipping_method end |