lightspeed_ruby 0.1.5 → 0.1.6

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: 24292e2be0e108391527b5a082702ed2469972ca
4
- data.tar.gz: 200dca39d1a5bddb8ab0062e196bcbd73993a508
3
+ metadata.gz: 70756658a7433866f744d68f9294e31fd42a6ad5
4
+ data.tar.gz: c83baf2addb95a911bd96e6acb0c1dd8f1a17fa1
5
5
  SHA512:
6
- metadata.gz: ba1fb6f34da8fc8035f95e0acb4d7228d533a74ac7fee632783078eb93cd577b6e4b395fd034c9655c6af555b5e2eeca56d740e9c3c40fad20d8f09dc3144943
7
- data.tar.gz: fec09d4ad79081243c3cf0e84632f5c0806ef50ec20a74a48068012ae4fa163b12a8b55c319f58ee44d0502c863b7a6597c32b38d9e9c48ae25a714f230db794
6
+ metadata.gz: 350c47137559618a99a36c8ca452914c2371f45700f556995f51ad4422a4e0c1781d29cff6db463fdaef24c85500498a3dd2fbe0c36d9e0a9f67426ac4093339
7
+ data.tar.gz: d468b373e9763a4cf8566a425279f7c6fadd223bafec20746a9cf05b474418fc5aad2bfbf4e23cb6a2814e453c108fdc221b4594c065d740bd2a5f3bff94dde7
@@ -9,6 +9,14 @@ module Lightspeed
9
9
  client.get("Account/#{client.account_id}/Customer/#{customer_id}.json", relations: with).body
10
10
  end
11
11
 
12
+ def create(attributes = {})
13
+ client.post("Account/#{client.account_id}/Customer.json", body: attributes).body
14
+ end
15
+
16
+ def update(customer_id, attributes = {})
17
+ client.put("Account/#{client.account_id}/Customer/#{customer_id}.json", body: attributes)
18
+ end
19
+
12
20
  private
13
21
 
14
22
  attr_reader :client
@@ -13,6 +13,10 @@ module Lightspeed
13
13
  client.get("Account/#{client.account_id}/Sale/#{sale_id}.json", relations: with).body
14
14
  end
15
15
 
16
+ def update(sale_id, attributes = {})
17
+ client.put("Account/#{client.account_id}/Sale/#{sale_id}.json", body: attributes).body
18
+ end
19
+
16
20
  private
17
21
 
18
22
  attr_reader :client
@@ -32,6 +32,10 @@ module Lightspeed
32
32
  conn.delete(url)
33
33
  end
34
34
 
35
+ def put(url, body: {})
36
+ conn.put(url, body)
37
+ end
38
+
35
39
  def accounts; API::Accounts.new(self); end
36
40
  def sales; API::Sales.new(self); end
37
41
  def customers; API::Customers.new(self); end
@@ -1,3 +1,3 @@
1
1
  module Lightspeed
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lightspeed_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zamith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2017-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler