Class: ActiveMerchant::Shipping::TrackingResponse
- Defined in:
- lib/active_shipping/shipping/tracking_response.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#shipment_events ⇒ Object
readonly
array of ShipmentEvents in chronological order.
-
#tracking_number ⇒ Object
readonly
string.
Attributes inherited from Response
#message, #params, #request, #test, #xml
Instance Method Summary collapse
-
#initialize(success, message, params = {}, options = {}) ⇒ TrackingResponse
constructor
A new instance of TrackingResponse.
- #latest_event ⇒ Object
Methods inherited from Response
Constructor Details
#initialize(success, message, params = {}, options = {}) ⇒ TrackingResponse
Returns a new instance of TrackingResponse.
9 10 11 12 13 14 |
# File 'lib/active_shipping/shipping/tracking_response.rb', line 9 def initialize(success, , params = {}, = {}) @tracking_number = [:tracking_number] @shipment_events = Array([:shipment_events]) @origin, @destination = [:origin], [:destination] super end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
7 8 9 |
# File 'lib/active_shipping/shipping/tracking_response.rb', line 7 def destination @destination end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
7 8 9 |
# File 'lib/active_shipping/shipping/tracking_response.rb', line 7 def origin @origin end |
#shipment_events ⇒ Object (readonly)
array of ShipmentEvents in chronological order
6 7 8 |
# File 'lib/active_shipping/shipping/tracking_response.rb', line 6 def shipment_events @shipment_events end |
#tracking_number ⇒ Object (readonly)
string
5 6 7 |
# File 'lib/active_shipping/shipping/tracking_response.rb', line 5 def tracking_number @tracking_number end |
Instance Method Details
#latest_event ⇒ Object
16 17 18 |
# File 'lib/active_shipping/shipping/tracking_response.rb', line 16 def latest_event @shipment_events.last end |