Class: FriendlyShipping::Services::ShipEngine::RateEstimatesOptions
- Inherits:
-
FriendlyShipping::ShipmentOptions
- Object
- FriendlyShipping::ShipmentOptions
- FriendlyShipping::Services::ShipEngine::RateEstimatesOptions
- Defined in:
- lib/friendly_shipping/services/ship_engine/rate_estimates_options.rb
Overview
Options for the rate estimates API call.
Instance Attribute Summary collapse
-
#carriers ⇒ Array<Carrier>
readonly
The carriers for these rate estimates.
- #ship_date ⇒ #strftime readonly
Instance Method Summary collapse
-
#carrier_ids ⇒ Array<String>
The carrier IDs for these rate estimates.
-
#initialize(carriers:, ship_date: Date.today, **kwargs) ⇒ RateEstimatesOptions
constructor
A new instance of RateEstimatesOptions.
Methods inherited from FriendlyShipping::ShipmentOptions
Constructor Details
#initialize(carriers:, ship_date: Date.today, **kwargs) ⇒ RateEstimatesOptions
Returns a new instance of RateEstimatesOptions.
19 20 21 22 23 24 25 26 27 |
# File 'lib/friendly_shipping/services/ship_engine/rate_estimates_options.rb', line 19 def initialize( carriers:, ship_date: Date.today, **kwargs ) @carriers = carriers @ship_date = ship_date super(**kwargs) end |
Instance Attribute Details
#carriers ⇒ Array<Carrier> (readonly)
Returns the carriers for these rate estimates.
9 10 11 |
# File 'lib/friendly_shipping/services/ship_engine/rate_estimates_options.rb', line 9 def carriers @carriers end |
#ship_date ⇒ #strftime (readonly)
12 13 14 |
# File 'lib/friendly_shipping/services/ship_engine/rate_estimates_options.rb', line 12 def ship_date @ship_date end |
Instance Method Details
#carrier_ids ⇒ Array<String>
Returns the carrier IDs for these rate estimates.
30 31 32 |
# File 'lib/friendly_shipping/services/ship_engine/rate_estimates_options.rb', line 30 def carrier_ids carriers.map(&:id) end |