Class: CDEKApiClient::API::TrackOrder
- Inherits:
-
Object
- Object
- CDEKApiClient::API::TrackOrder
- Defined in:
- lib/cdek_api_client/api/track_order.rb
Overview
Handles order tracking requests to the CDEK API.
Constant Summary collapse
- BASE_URL =
ENV.fetch('CDEK_API_URL', 'https://api.edu.cdek.ru/v2')
- TRACK_ORDER_URL =
"#{BASE_URL}/orders/%<uuid>s".freeze
Instance Method Summary collapse
-
#get(order_uuid) ⇒ Hash
Retrieves tracking information for an order.
-
#initialize(client) ⇒ TrackOrder
constructor
Initializes the TrackOrder object.
Constructor Details
#initialize(client) ⇒ TrackOrder
Initializes the TrackOrder object.
13 14 15 |
# File 'lib/cdek_api_client/api/track_order.rb', line 13 def initialize(client) @client = client end |
Instance Method Details
#get(order_uuid) ⇒ Hash
Retrieves tracking information for an order.
22 23 24 25 26 27 |
# File 'lib/cdek_api_client/api/track_order.rb', line 22 def get(order_uuid) validate_uuid(order_uuid) response = @client.auth_connection.get(format(TRACK_ORDER_URL, uuid: order_uuid)) handle_response(response) end |