lightspeed_ruby 0.1.6 → 0.1.7
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e52341b323c00da0c6ad01498b66bad6a9431e6d
|
4
|
+
data.tar.gz: 4ee83844f162afc1a77b641c222c7f326fb84e60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/lightspeed/api/items.rb
CHANGED
@@ -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
|
data/lib/lightspeed/version.rb
CHANGED
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.
|
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-
|
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
|