Method: ActiveShipping::RateResponse#rates

Defined in:
lib/active_shipping/rate_response.rb,
lib/active_shipping/rate_response.rb

#ratesArray<ActiveShipping::RateEstimate> Also known as: estimates, rate_estimates

The available rate options for the shipment, with an estimated price.

Returns:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/active_shipping/rate_response.rb', line 13

class RateResponse < Response

  attr_reader :rates

  # Initializes a new RateResponse instance.
  #
  # @param success (see ActiveShipping::Response#initialize)
  # @param message (see ActiveShipping::Response#initialize)
  # @param params (see ActiveShipping::Response#initialize)
  # @option options (see ActiveShipping::Response#initialize)
  # @option options [Array<ActiveShipping::RateEstimate>] :rates The rate estimates to
  #   populate the {#rates} method with.
  def initialize(success, message, params = {}, options = {})
    @rates = Array(options[:estimates] || options[:rates] || options[:rate_estimates])
    super
  end

  alias_method :estimates, :rates
  alias_method :rate_estimates, :rates
end