lightspeed_restaurant 1.1.0 → 1.1.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a4c9f58fe22f8a8a77cb2be5d2032996e453f08
|
4
|
+
data.tar.gz: 6ffb93f47a7ebfbc09856d9ba84c5d61ab3e87af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 758a789a28515b0e3aaf4c496e7395bab6b48ae1847ba0a0198d8470e3ce4270ad8ac896393755409ae39b628da2d99cabdb783e84985738ed6882806e6eaf46
|
7
|
+
data.tar.gz: b5d95d5e6e7e3300e97274c9e08fdba70d3033b4d39ce9db9751c35f0273223ca19122dac0315517db7596ee7e954bb4c9796aeff136615abc8f94209222f0af
|
@@ -3,8 +3,19 @@ module LightspeedRestaurantClient
|
|
3
3
|
module Update
|
4
4
|
def update(id, attributes)
|
5
5
|
updated_object = new(attributes)
|
6
|
-
LightspeedRestaurantClient.put(resource_path + "/#{id}", updated_object)
|
7
|
-
|
6
|
+
response = LightspeedRestaurantClient.put(resource_path + "/#{id}", updated_object)
|
7
|
+
new(build_payload(attributes, response))
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def build_payload(attributes, response)
|
13
|
+
begin
|
14
|
+
return JSON.parse(response)
|
15
|
+
rescue JSON::ParserError => error
|
16
|
+
raise error if response.to_i.zero?
|
17
|
+
end
|
18
|
+
attributes.merge!(id: response.to_i)
|
8
19
|
end
|
9
20
|
end
|
10
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lightspeed_restaurant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Buffon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|