Class: DhlEcommerce::Client
- Inherits:
-
Object
- Object
- DhlEcommerce::Client
- Includes:
- Connection, Endpoints, HTTParty
- Defined in:
- lib/dhl_ecommerce.rb,
lib/dhl_ecommerce/endpoints.rb,
lib/dhl_ecommerce/connection.rb
Defined Under Namespace
Modules: Connection, Endpoints
Instance Method Summary collapse
-
#initialize(client_id: '', password: '', production_env: false) ⇒ Client
constructor
A new instance of Client.
Methods included from Endpoints
#create_label, #destroy_shipment, #track
Methods included from Connection
Constructor Details
#initialize(client_id: '', password: '', production_env: false) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 20 |
# File 'lib/dhl_ecommerce.rb', line 14 def initialize(client_id: '', password: '', production_env: false) self.class.base_uri (production_env ? PRODUCTION_BASE_URL : SANDBOX_BASE_URL) @client_id = client_id @password = password authenticate! self.class..merge!(headers: { 'content-type': 'application/json' }) end |