fulfil_api 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22b6b63d1460a3a0d6b6c5ef3b33b018291d6919a27c32664c7649922a930852
4
- data.tar.gz: 0a87ce490bca0026c5764ded0e887a3cdffd4cf0d9a3f13bcfd8e5a5a888cb43
3
+ metadata.gz: 0b2f385c53e1a0cb8df12a9869060c93d5e0cf24dbdf9277f104a68ac36d5d62
4
+ data.tar.gz: 82981d13dcb644beb81712d8c6784990007f926c44137890ce1cb6d28a3e59df
5
5
  SHA512:
6
- metadata.gz: dedeecd3042e63045c2a5215d5bc6121c99a0863a65db953657cef068ff75f060271533d8ce2dd39a9b24ca94834b5b0b1282778ba6f0fb8d18efd419ecdff32
7
- data.tar.gz: b39a10b911e3c9909cb7f21bfdf4cde91db64438eb6060a54700e4596ec4fe32961b691e49f4370211fdca0f8b343b0c63421ccfeb6d5959b6c05524ba415a94
6
+ metadata.gz: fafc5b8317be062615e13d6a390f5f7e49557d9039957faad958225f7a264be29da6e556803bd914654a77b2c30365d19f431592748459c7dcba5f810546bb22
7
+ data.tar.gz: 5ff7b0cef942956dc814d7761fc97c939111e299abe54e228af8e3dde10bd257de4772b83389126be001236f0a9b8f0f80fe17b493ff981b4821be0fe766c9e1
data/README.md CHANGED
@@ -153,16 +153,16 @@ The 3PL client is accessible via `FulfilApi.tpl_client` and supports the standar
153
153
 
154
154
  ```ruby
155
155
  # GET request with optional URL parameters
156
- FulfilApi.tpl_client.get("inbound-transfers", url_parameters: { page: 1, per_page: 25 })
156
+ FulfilApi.tpl_client.get("inbound-transfers", page: 1, per_page: 25)
157
157
 
158
158
  # POST request with a request body
159
- FulfilApi.tpl_client.post("inbound-transfers/receive.json", body: { tracking_number: "ABC123" })
159
+ FulfilApi.tpl_client.post("inbound-transfers/receive.json", { tracking_number: "ABC123" })
160
160
 
161
161
  # PUT request with a request body
162
- FulfilApi.tpl_client.put("inbound-transfers/receive.json", body: { status: "received" })
162
+ FulfilApi.tpl_client.put("inbound-transfers/receive.json", { status: "received" })
163
163
 
164
164
  # PATCH request with a request body
165
- FulfilApi.tpl_client.patch("inbound-transfers/receive.json", body: { status: "received" })
165
+ FulfilApi.tpl_client.patch("inbound-transfers/receive.json", { status: "received" })
166
166
 
167
167
  ```
168
168
 
@@ -9,8 +9,8 @@ module FulfilApi
9
9
  # the 3PL supplier API using standard HTTP methods.
10
10
  #
11
11
  # @example Using the TPL client
12
- # FulfilApi.tpl_client.get("inbound-transfers", url_parameters: { page: 1 })
13
- # FulfilApi.tpl_client.post("inbound-transfers/receive.json", body: { tracking_number: "123" })
12
+ # FulfilApi.tpl_client.get("inbound-transfers", page: 1)
13
+ # FulfilApi.tpl_client.post("inbound-transfers/receive.json", { tracking_number: "123" })
14
14
  class TplClient
15
15
  class ConfigurationError < FulfilApi::Error; end
16
16
 
@@ -33,10 +33,10 @@ module FulfilApi
33
33
  # Performs an HTTP GET request to a 3PL API endpoint.
34
34
  #
35
35
  # @param relative_path [String] The relative path to the endpoint.
36
- # @param url_parameters [Hash, nil] The optional URL parameters for the API endpoint.
36
+ # @param url_parameters [Hash] The optional URL parameters for the API endpoint.
37
37
  # @return [Array, Hash, String] The parsed response body.
38
- def get(relative_path, url_parameters: nil)
39
- request(:get, relative_path, url_parameters)
38
+ def get(relative_path, **url_parameters)
39
+ request(:get, relative_path, url_parameters.presence)
40
40
  end
41
41
 
42
42
  # Performs an HTTP PATCH request to a 3PL API endpoint.
@@ -44,7 +44,7 @@ module FulfilApi
44
44
  # @param relative_path [String] The relative path to the endpoint.
45
45
  # @param body [Array, Hash, nil] The request body for the PATCH HTTP request.
46
46
  # @return [Array, Hash, String] The parsed response body.
47
- def patch(relative_path, body: {})
47
+ def patch(relative_path, body = {})
48
48
  request(:patch, relative_path, body)
49
49
  end
50
50
 
@@ -53,7 +53,7 @@ module FulfilApi
53
53
  # @param relative_path [String] The relative path to the endpoint.
54
54
  # @param body [Array, Hash, nil] The request body for the POST HTTP request.
55
55
  # @return [Array, Hash, String] The parsed response body.
56
- def post(relative_path, body: {})
56
+ def post(relative_path, body = {})
57
57
  request(:post, relative_path, body)
58
58
  end
59
59
 
@@ -62,7 +62,7 @@ module FulfilApi
62
62
  # @param relative_path [String] The relative path to the endpoint.
63
63
  # @param body [Array, Hash, nil] The optional request body for the PUT HTTP request.
64
64
  # @return [Array, Hash, String] The parsed response body.
65
- def put(relative_path, body: nil)
65
+ def put(relative_path, body = nil)
66
66
  return request(:put, relative_path) if body.nil?
67
67
 
68
68
  request(:put, relative_path, body)
@@ -137,7 +137,7 @@ module FulfilApi
137
137
  #
138
138
  # @example
139
139
  # FulfilApi.tpl_client.get("inbound-transfers")
140
- # FulfilApi.tpl_client.post("inbound-transfers/receive.json", body: { tracking_number: "123" })
140
+ # FulfilApi.tpl_client.post("inbound-transfers/receive.json", { tracking_number: "123" })
141
141
  #
142
142
  # @return [FulfilApi::TplClient]
143
143
  def self.tpl_client
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FulfilApi
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fulfil_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas