Sha256: a9af856cd8edb9432e6f2c1797bf0332e6fe5771e27374137eb12bcbd9f41838

Contents?: true

Size: 1.33 KB

Versions: 23

Compression:

Stored size: 1.33 KB

Contents

module ActiveShipping

  # Responce object class for calls to {ActiveShipping::Carrier#create_shipment}.
  #
  # @note Some carriers provide more information that others, so not all attributes
  #   will be set, depending on what carrier you are using.
  #
  # @!attribute shipping_id
  #   The unique identifier of the shipment, which can be used to further interact
  #   with the carrier's API.
  #   @return [String]
  #
  # @!attribute tracking_number
  #   The tracking number of the shipments, which can be shared with the customer and
  #   be used for {ActiveShipping::Carrier#find_tracking_info}.
  #   @return [String]
  class ShippingResponse < Response
    attr_reader :shipping_id, :tracking_number

    # Initializes a new ShippingResponse 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 [String] :shipping_id Populates {#shipping_id}.
    # @option options [String] :tracking_number Populates {#tracking_number}.
    def initialize(success, message, params = {}, options = {})
      @shipping_id = options[:shipping_id]
      @tracking_number = options[:tracking_number]
      super
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
active_shipping-2.1.1 lib/active_shipping/shipping_response.rb
active_shipping-2.1.0 lib/active_shipping/shipping_response.rb
active_shipping-2.0.1 lib/active_shipping/shipping_response.rb
active_shipping-2.0.0 lib/active_shipping/shipping_response.rb
active_shipping-1.14.2 lib/active_shipping/shipping_response.rb
active_shipping-1.14.1 lib/active_shipping/shipping_response.rb
active_shipping-1.14.0 lib/active_shipping/shipping_response.rb
active_shipping-1.13.4 lib/active_shipping/shipping_response.rb
active_shipping-1.13.3 lib/active_shipping/shipping_response.rb
active_shipping-1.13.2 lib/active_shipping/shipping_response.rb
active_shipping-1.13.1 lib/active_shipping/shipping_response.rb
active_shipping-1.13.0 lib/active_shipping/shipping_response.rb
active_shipping-1.12.1 lib/active_shipping/shipping_response.rb
active_shipping-1.12.0 lib/active_shipping/shipping_response.rb
active_shipping-1.11.1 lib/active_shipping/shipping_response.rb
active_shipping-1.11.0 lib/active_shipping/shipping_response.rb
active_shipping-1.10.1 lib/active_shipping/shipping_response.rb
active_shipping-1.9.2 lib/active_shipping/shipping_response.rb
active_shipping-1.9.1 lib/active_shipping/shipping_response.rb
active_shipping-1.9.0 lib/active_shipping/shipping_response.rb