lightspeed_restaurant 0.2.0 → 0.3.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6eb37ce6d16f98c585de5a3f6d6a5677c8933563
|
|
4
|
+
data.tar.gz: 93dd6eff2fba93d642fc41503d19ebd9f26a8498
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a5baf605910309b91b822f218875669052081effb106b0dc2acf719cb848e7e6b45d8bd01d0c1eee28ac4f5a93763a4a814c97c9a4d82a79991ca490d1ce6543
|
|
7
|
+
data.tar.gz: 33861ba202a5f6b1c3ed9470a55bab91f2ee4a97f0efbf6ceb198c5dc21a6b874c90c73c1d31dd4c10365fc6945fd1f81b8d2ef0e63f900039ded7deb3990ecc
|
|
@@ -10,6 +10,7 @@ require 'lightspeed_restaurant/request'
|
|
|
10
10
|
require 'lightspeed_restaurant/customer'
|
|
11
11
|
require 'lightspeed_restaurant/customer_credit_change'
|
|
12
12
|
require 'lightspeed_restaurant/receipt'
|
|
13
|
+
require 'lightspeed_restaurant/company'
|
|
13
14
|
|
|
14
15
|
module LightspeedRestaurant
|
|
15
16
|
class << self
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'lightspeed_restaurant/base'
|
|
2
|
+
require 'lightspeed_restaurant/operations/list'
|
|
3
|
+
|
|
4
|
+
module LightspeedRestaurant
|
|
5
|
+
class Company < LightspeedRestaurant::Base
|
|
6
|
+
extend Operations::List
|
|
7
|
+
|
|
8
|
+
def self.resource_name
|
|
9
|
+
'Company'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.resource_path
|
|
13
|
+
"/rest/core/#{resource_name.downcase}"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -3,7 +3,8 @@ module LightspeedRestaurant
|
|
|
3
3
|
module List
|
|
4
4
|
def list(params = {})
|
|
5
5
|
response = JSON.parse(LightspeedRestaurant.get(resource_path, {}, params))
|
|
6
|
-
|
|
6
|
+
results = response.is_a?(Array) ? response : response['results']
|
|
7
|
+
instantiate(results)
|
|
7
8
|
end
|
|
8
9
|
alias all list
|
|
9
10
|
|
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: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Olivier Buffon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: excon
|
|
@@ -174,6 +174,7 @@ files:
|
|
|
174
174
|
- circle.yml
|
|
175
175
|
- lib/lightspeed_restaurant.rb
|
|
176
176
|
- lib/lightspeed_restaurant/base.rb
|
|
177
|
+
- lib/lightspeed_restaurant/company.rb
|
|
177
178
|
- lib/lightspeed_restaurant/customer.rb
|
|
178
179
|
- lib/lightspeed_restaurant/customer_credit_change.rb
|
|
179
180
|
- lib/lightspeed_restaurant/errors/api_error.rb
|