lightspeed_restaurant 0.2.0 → 0.3.0

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: 56e75042c46fc74a5583e60722906e07bc755f82
4
- data.tar.gz: 67491992739dc6b5004472eea7073a2e3e09b159
3
+ metadata.gz: 6eb37ce6d16f98c585de5a3f6d6a5677c8933563
4
+ data.tar.gz: 93dd6eff2fba93d642fc41503d19ebd9f26a8498
5
5
  SHA512:
6
- metadata.gz: 998ec24bb48dcade87256889928a07ab3752f19cf843f2372fe8c869891615a1784215c815787947da3e0ccd1f6e8ec6f9b5fa44705906fcfd36021b326c1c98
7
- data.tar.gz: 4225df362838635e0583e129f9a080dd54415531352e48dea5de0be46d171fc5f909af87527d332238a571ab5f251ead8268acbfd0a3b2dd36da009874f153fc
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
- instantiate(response['results'])
6
+ results = response.is_a?(Array) ? response : response['results']
7
+ instantiate(results)
7
8
  end
8
9
  alias all list
9
10
 
@@ -1,3 +1,3 @@
1
1
  module LightspeedRestaurant
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  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: 0.2.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-03-13 00:00:00.000000000 Z
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