Class: DHLAPI::TrackingClient

Inherits:
BaseClient show all
Defined in:
lib/dhl_api/clients/tracking_client.rb

Constant Summary collapse

URL =
'https://api-eu.dhl.com/track/shipments'
TEST_URL =
'https://api-test.dhl.com/track/shipments'

Instance Attribute Summary

Attributes inherited from BaseClient

#http_client, #response

Instance Method Summary collapse

Methods inherited from BaseClient

#connection

Instance Method Details

#track(attributes = {}) ⇒ Object



6
7
8
9
10
# File 'lib/dhl_api/clients/tracking_client.rb', line 6

def track(attributes = {})
  attributes = attributes.deep_transform_keys { |key| key.to_s.camelize(:lower) }
  self.response = connection.get(url, params: attributes)
  Tracking.new handle_response.parse
end