Class: ReactiveShipping::ShippingResponse
- Defined in:
- lib/reactive_shipping/shipping_response.rb
Overview
Some carriers provide more information that others, so not all attributes will be set, depending on what carrier you are using.
Responce object class for calls to Carrier#create_shipment.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#shipping_id ⇒ String
The unique identifier of the shipment, which can be used to further interact with the carrier's API.
-
#tracking_number ⇒ String
The tracking number of the shipments, which can be shared with the customer and be used for Carrier#find_tracking_info.
Attributes inherited from Response
#message, #params, #request, #test, #xml
Instance Method Summary collapse
-
#initialize(success, message, params = {}, options = {}) ⇒ ShippingResponse
constructor
Initializes a new ShippingResponse instance.
Methods inherited from Response
Constructor Details
#initialize(success, message, params = {}, options = {}) ⇒ ShippingResponse
Initializes a new ShippingResponse instance.
28 29 30 31 32 |
# File 'lib/reactive_shipping/shipping_response.rb', line 28 def initialize(success, , params = {}, = {}) @shipping_id = [:shipping_id] @tracking_number = [:tracking_number] super end |
Instance Attribute Details
#shipping_id ⇒ String
The unique identifier of the shipment, which can be used to further interact with the carrier's API.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/reactive_shipping/shipping_response.rb', line 17 class ShippingResponse < Response attr_reader :shipping_id, :tracking_number # Initializes a new ShippingResponse instance. # # @param success (see ReactiveShipping::Response#initialize) # @param message (see ReactiveShipping::Response#initialize) # @param params (see ReactiveShipping::Response#initialize) # @option options (see ReactiveShipping::Response#initialize) # @option options [String] :shipping_id Populates {#shipping_id}. # @option options [String] :tracking_number Populates {#tracking_number}. def initialize(success, , params = {}, = {}) @shipping_id = [:shipping_id] @tracking_number = [:tracking_number] super end end |
#tracking_number ⇒ String
The tracking number of the shipments, which can be shared with the customer and be used for Carrier#find_tracking_info.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/reactive_shipping/shipping_response.rb', line 17 class ShippingResponse < Response attr_reader :shipping_id, :tracking_number # Initializes a new ShippingResponse instance. # # @param success (see ReactiveShipping::Response#initialize) # @param message (see ReactiveShipping::Response#initialize) # @param params (see ReactiveShipping::Response#initialize) # @option options (see ReactiveShipping::Response#initialize) # @option options [String] :shipping_id Populates {#shipping_id}. # @option options [String] :tracking_number Populates {#tracking_number}. def initialize(success, , params = {}, = {}) @shipping_id = [:shipping_id] @tracking_number = [:tracking_number] super end end |