lightspeed_ruby 0.1.6 → 0.1.7

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: 70756658a7433866f744d68f9294e31fd42a6ad5
4
- data.tar.gz: c83baf2addb95a911bd96e6acb0c1dd8f1a17fa1
3
+ metadata.gz: e52341b323c00da0c6ad01498b66bad6a9431e6d
4
+ data.tar.gz: 4ee83844f162afc1a77b641c222c7f326fb84e60
5
5
  SHA512:
6
- metadata.gz: 350c47137559618a99a36c8ca452914c2371f45700f556995f51ad4422a4e0c1781d29cff6db463fdaef24c85500498a3dd2fbe0c36d9e0a9f67426ac4093339
7
- data.tar.gz: d468b373e9763a4cf8566a425279f7c6fadd223bafec20746a9cf05b474418fc5aad2bfbf4e23cb6a2814e453c108fdc221b4594c065d740bd2a5f3bff94dde7
6
+ metadata.gz: 18949860cf7361741f0a67f03e0f8c68fe68560da1993b5bd62f7b84906d3a62fe9d85f2c0b8a2e6e5ce5de4b82896114b6ce8a165abe579ab00e65439ea1288
7
+ data.tar.gz: 20209319126a5ee95f5e84f4f5ca8a3c8860f172a4242877598de98ab80b447c5963c57d8a82f4b4249502dab315d17e3431e3bdb8c8531c1e370889c52e7801
@@ -0,0 +1,23 @@
1
+ module Lightspeed
2
+ module API
3
+ class Items
4
+ class CustomFields
5
+ class CustomFieldChoices
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ def all(field_id)
11
+ client.
12
+ get("Account/#{client.account_id}/Item/CustomField/#{field_id}/CustomFieldChoice.json").
13
+ body
14
+ end
15
+
16
+ private
17
+
18
+ attr_reader :client
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,25 @@
1
+ require "lightspeed/api/items/custom_fields/custom_field_choices"
2
+
3
+ module Lightspeed
4
+ module API
5
+ class Items
6
+ class CustomFields
7
+ def initialize(client)
8
+ @client = client
9
+ end
10
+
11
+ def custom_field_choices; API::Items::CustomFields::CustomFieldChoices.new(client); end
12
+
13
+ def all
14
+ client.
15
+ get("Account/#{client.account_id}/Item/CustomField.json").
16
+ body
17
+ end
18
+
19
+ private
20
+
21
+ attr_reader :client
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,3 +1,5 @@
1
+ require "lightspeed/api/items/custom_fields"
2
+
1
3
  module Lightspeed
2
4
  module API
3
5
  class Items
@@ -5,6 +7,12 @@ module Lightspeed
5
7
  @client = client
6
8
  end
7
9
 
10
+ def custom_fields; Items::CustomFields.new(client); end
11
+
12
+ def all
13
+ client.get("Account/#{client.account_id}/Item.json").body
14
+ end
15
+
8
16
  def find(item_id, with: [])
9
17
  client.get("Account/#{client.account_id}/Item/#{item_id}.json", relations: with).body
10
18
  end
@@ -17,6 +25,10 @@ module Lightspeed
17
25
  client.delete("Account/#{client.account_id}/Item/#{item_id}.json").body
18
26
  end
19
27
 
28
+ def update(item_id, attributes = {})
29
+ client.put("Account/#{client.account_id}/Item/#{item_id}.json", body: attributes).body
30
+ end
31
+
20
32
  private
21
33
 
22
34
  attr_reader :client
@@ -1,3 +1,3 @@
1
1
  module Lightspeed
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zamith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2017-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -101,6 +101,8 @@ files:
101
101
  - lib/lightspeed/api/categories.rb
102
102
  - lib/lightspeed/api/customers.rb
103
103
  - lib/lightspeed/api/items.rb
104
+ - lib/lightspeed/api/items/custom_fields.rb
105
+ - lib/lightspeed/api/items/custom_fields/custom_field_choices.rb
104
106
  - lib/lightspeed/api/sales.rb
105
107
  - lib/lightspeed/api/sales/sale_lines.rb
106
108
  - lib/lightspeed/api/tokens.rb