ruby-jet 0.12.0 → 0.13.0
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 +4 -4
- data/lib/jet/client.rb +6 -0
- data/lib/jet/client/products.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1895197a3daf65b5af2c50a20d4abd6acfbad4b5
|
4
|
+
data.tar.gz: 4b0a66192fa030ff36ca58248caca355c2180216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf02f6893b56c858a62ae5cd4b14e47f511718865689aa966f6efc400e75eccfaba9423ac4a3cbf2a94cdcd58b5e54d29b56327c12486db1d6c33ab43dd165f
|
7
|
+
data.tar.gz: 848a0174db383e795328ec2255e9858097c513ebe124a33cf392b069314e9c620f3e2811271c21df6b99bf16a409457a45f639e1dc9dbce69b3157e56b524aa4
|
data/lib/jet/client.rb
CHANGED
@@ -75,6 +75,12 @@ module Jet
|
|
75
75
|
decode_json(response.body) if response.code == 201
|
76
76
|
end
|
77
77
|
|
78
|
+
def rest_patch_with_token(path, body = {})
|
79
|
+
headers = token
|
80
|
+
response = RestClient.patch("#{API_URL}#{path}", encode_json(body), headers)
|
81
|
+
decode_json(response.body) if response.code == 200
|
82
|
+
end
|
83
|
+
|
78
84
|
def orders
|
79
85
|
Orders.new(self)
|
80
86
|
end
|
data/lib/jet/client/products.rb
CHANGED
@@ -7,7 +7,7 @@ module Jet
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def update_inventory(merchant_sku, body = {})
|
10
|
-
@client.
|
10
|
+
@client.rest_patch_with_token("/merchant-skus/#{merchant_sku}/inventory", body)
|
11
11
|
end
|
12
12
|
|
13
13
|
def get_inventory(merchant_sku)
|