dhl_api 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38fd924f15b98dc8f683c50ae9f377b7d79ab3dec1f0cbfc5d3641653a51350d
4
- data.tar.gz: 1d7d0afcf7949e90026ea3b2ee81912423f3c61a71f6a3b97b7b36082a29d56f
3
+ metadata.gz: 926c694d2d3c2c5f278c62e10f8aa014b86480f8d2f3207f7fe42ab8891febd0
4
+ data.tar.gz: 838f29f55a1693c6d007537b65c970a1e59e5c4ce45d54775eb818f658668b1f
5
5
  SHA512:
6
- metadata.gz: 12709605fc3a4c59c9be84afd4764c14d72c75b88e544d77436f7b670bd89bbc90e7e84aa1f1d505d0201cd2289f847336066a32d75713f0b04ca49469eb5715
7
- data.tar.gz: d65f5bdeae686f719320815e817b183ccaca6be69869919600c754fc11f779b0a5f6002fff557e93e89818f89258a853364f10446b7a6e07d2c7c166b9b396e3
6
+ metadata.gz: bc318898989145a21275132969bf2e891d86e9cba18117f58ba2db428152d1b249099595828b4a9c9b9ddffab65a057d3290ce22c5ac9e664a36e1084898c559
7
+ data.tar.gz: 6dd5d180bb173446a7bde4e21188c2d50ae0ee8e697141bf22ef4e56fa4fd191f0048e762f8b51299d23aa39d0dccd246eb7fcc34d51046f8a9daf9308a584f1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
- ## [Unreleased]
1
+ ## [0.1.2] - 2023-06-27
2
2
 
3
- ## [0.1.0] - 2023-06-22
3
+ - Transform payload keys to lowerCamel before send.
4
+
5
+ ## [0.1.1] - 2023-06-26
6
+
7
+ - Rename DHL constant to DHLAPI
8
+ - Rename dhl to dhl_api
9
+
10
+ ## [0.1.0] - 2023-06-26
4
11
 
5
12
  - Initial release
13
+ - Add Retoure label creation
14
+ - Add Unified Tracking
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # DHLAPI
1
+ # DHL API
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dhl_api`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This is a Ruby API wrapper for DHL. Right now, we only cover Retoure & Tracking. Feel free to extend the gem t cover more DHL services.
6
4
 
7
5
  ## Installation
8
6
 
@@ -72,7 +70,7 @@ tracking = track_client.track(tracking_number: '420025369374810912402173942693')
72
70
 
73
71
  # You can access the raw response by calling by calling the #response:
74
72
  retoure_client.response
75
- tracking_client.response
73
+ track_client.response
76
74
  # It is a HTTP::Response object. See https://github.com/httprb/http/wiki/Response-Handling for more info.
77
75
 
78
76
  # You can access the raw attributes before the keys is parsed to snake_case by calling the #attributes:
@@ -17,7 +17,8 @@ module DHLAPI
17
17
  attr_accessor :label_type
18
18
 
19
19
  def create_label(attributes = {})
20
- self.response = connection.post(url, json: attributes, params: { labelType: label_type })
20
+ payload = attributes.deep_transform_keys { |key| key.to_s.camelize(:lower) }
21
+ self.response = connection.post(url, json: payload, params: { labelType: label_type })
21
22
  RetoureLabel.new handle_response.parse
22
23
  end
23
24
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DHLAPI
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhl_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Chong
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-26 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport