Class: ActiveMerchant::Shipping::TrackingResponse

Inherits:
Response show all
Defined in:
lib/active_shipping/shipping/tracking_response.rb

Instance Attribute Summary collapse

Attributes inherited from Response

#message, #params, #request, #test, #xml

Instance Method Summary collapse

Methods inherited from Response

#success?, #test?

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, message, params = {}, options = {})
  @tracking_number = options[:tracking_number]
  @shipment_events = Array(options[:shipment_events])
  @origin, @destination = options[:origin], options[:destination]
  super
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



7
8
9
# File 'lib/active_shipping/shipping/tracking_response.rb', line 7

def destination
  @destination
end

#originObject (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_eventsObject (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_numberObject (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_eventObject



16
17
18
# File 'lib/active_shipping/shipping/tracking_response.rb', line 16

def latest_event
  @shipment_events.last
end