Class: Omniship::TrackingResponse
- Defined in:
- lib/omniship/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.
7 8 9 10 11 12 |
# File 'lib/omniship/tracking_response.rb', line 7 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.
5 6 7 |
# File 'lib/omniship/tracking_response.rb', line 5 def destination @destination end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
5 6 7 |
# File 'lib/omniship/tracking_response.rb', line 5 def origin @origin end |
#shipment_events ⇒ Object (readonly)
array of ShipmentEvents in chronological order
4 5 6 |
# File 'lib/omniship/tracking_response.rb', line 4 def shipment_events @shipment_events end |
#tracking_number ⇒ Object (readonly)
string
3 4 5 |
# File 'lib/omniship/tracking_response.rb', line 3 def tracking_number @tracking_number end |
Instance Method Details
#latest_event ⇒ Object
14 15 16 |
# File 'lib/omniship/tracking_response.rb', line 14 def latest_event @shipment_events.last end |