Class: DHLEcommerceEU::TrackingResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- DHLEcommerceEU::TrackingResource
- Defined in:
- lib/dhl_ecommerce_eu/resources/tracking_resource.rb
Instance Attribute Summary
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#retrieve(shipment_id) ⇒ Tracking[]
Retrieve tracking information for a shipment.
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from DHLEcommerceEU::BaseResource
Instance Method Details
#retrieve(shipment_id) ⇒ Tracking[]
Retrieve tracking information for a shipment
10 11 12 13 14 15 16 17 |
# File 'lib/dhl_ecommerce_eu/resources/tracking_resource.rb', line 10 def retrieve(shipment_id) payload = get_request('ccc/track-trace', params: { shipmentId: shipment_id }).parse if payload.is_a?(Array) payload.map(&Tracking.method(:new)) else Tracking.new(payload) end end |