lightspeed_restaurant 0.3.0 → 1.0.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: 6eb37ce6d16f98c585de5a3f6d6a5677c8933563
4
- data.tar.gz: 93dd6eff2fba93d642fc41503d19ebd9f26a8498
3
+ metadata.gz: c0186cb16478695e6d02aff5fe4b6e2711a43fda
4
+ data.tar.gz: 106ec14d75d86227e7b1a5de915425298e229e2f
5
5
  SHA512:
6
- metadata.gz: a5baf605910309b91b822f218875669052081effb106b0dc2acf719cb848e7e6b45d8bd01d0c1eee28ac4f5a93763a4a814c97c9a4d82a79991ca490d1ce6543
7
- data.tar.gz: 33861ba202a5f6b1c3ed9470a55bab91f2ee4a97f0efbf6ceb198c5dc21a6b874c90c73c1d31dd4c10365fc6945fd1f81b8d2ef0e63f900039ded7deb3990ecc
6
+ metadata.gz: 3a3830ef03d1aead52f6349f4e6a19842f13b8250a85e648049ab816dee2f25dcf8772ec75d5c45125fe14f8992c27a3edd8f03ef40ac283d4729979e14d3be1
7
+ data.tar.gz: d2767d9d5e12d7c7c169b627b8dae25aa5134505694e9710f7d10ecebc44b541527dae1ea73572bab4d811865f0577d1e472dace3203ed580df54af8cd8aa67c
data/README.md CHANGED
@@ -27,11 +27,11 @@ Or install it yourself as:
27
27
 
28
28
  First, set your api token:
29
29
  ```ruby
30
- LightspeedRestaurant.api_token = "YOUR_API_TOKEN_HERE"
30
+ LightspeedRestaurantClient.api_token = "YOUR_API_TOKEN_HERE"
31
31
  ```
32
32
  Next, make requests using the resource class you need:
33
33
  ```ruby
34
- customers = LightspeedRestaurant::Customer.all
34
+ customers = LightspeedRestaurantClient::Customer.all
35
35
  customer = customers.first
36
36
  customer.firstName = 'Tom'
37
37
  customer.save
@@ -43,34 +43,34 @@ That's it!
43
43
  #### List
44
44
 
45
45
  ```ruby
46
- LightspeedRestaurant::Customer.all
46
+ LightspeedRestaurantClient::Customer.all
47
47
  ```
48
48
 
49
49
  #### Find
50
50
  ```ruby
51
- LightspeedRestaurant::Customer.find(123)
51
+ LightspeedRestaurantClient::Customer.find(123)
52
52
  ```
53
53
 
54
54
  #### Create
55
55
  ```ruby
56
- LightspeedRestaurant::Customer.create(...firstName: 'Tom', email: 'tom@brady.com'...)
56
+ LightspeedRestaurantClient::Customer.create(...firstName: 'Tom', email: 'tom@brady.com'...)
57
57
  ```
58
58
 
59
59
  #### Update
60
60
  ```ruby
61
- LightspeedRestaurant::Customer.update(123, { email: 'tom@brady.com' })
61
+ LightspeedRestaurantClient::Customer.update(123, { email: 'tom@brady.com' })
62
62
  ```
63
63
 
64
64
  #### Save
65
65
  ```ruby
66
- customer = LightspeedRestaurant::Customer.find(123)
66
+ customer = LightspeedRestaurantClient::Customer.find(123)
67
67
  customer.firstName = 'Micheal'
68
68
  customer.save
69
69
  ```
70
70
 
71
71
  #### Destroy
72
72
  ```ruby
73
- customer = LightspeedRestaurant::Customer.find(123)
73
+ customer = LightspeedRestaurantClient::Customer.find(123)
74
74
  customer.destroy
75
75
  ```
76
76
 
@@ -12,7 +12,7 @@ require 'lightspeed_restaurant/customer_credit_change'
12
12
  require 'lightspeed_restaurant/receipt'
13
13
  require 'lightspeed_restaurant/company'
14
14
 
15
- module LightspeedRestaurant
15
+ module LightspeedRestaurantClient
16
16
  class << self
17
17
  attr_accessor :api_token, :base_uri
18
18
 
@@ -1,4 +1,4 @@
1
- module LightspeedRestaurant
1
+ module LightspeedRestaurantClient
2
2
  class Base
3
3
  def initialize(data = {})
4
4
  convert_to_obj(data)
@@ -1,8 +1,8 @@
1
1
  require 'lightspeed_restaurant/base'
2
2
  require 'lightspeed_restaurant/operations/list'
3
3
 
4
- module LightspeedRestaurant
5
- class Company < LightspeedRestaurant::Base
4
+ module LightspeedRestaurantClient
5
+ class Company < LightspeedRestaurantClient::Base
6
6
  extend Operations::List
7
7
 
8
8
  def self.resource_name
@@ -5,8 +5,8 @@ require 'lightspeed_restaurant/operations/create'
5
5
  require 'lightspeed_restaurant/operations/update'
6
6
  require 'lightspeed_restaurant/operations/save'
7
7
 
8
- module LightspeedRestaurant
9
- class Customer < LightspeedRestaurant::Base
8
+ module LightspeedRestaurantClient
9
+ class Customer < LightspeedRestaurantClient::Base
10
10
  include Operations::Save
11
11
  extend Operations::Create
12
12
  extend Operations::Update
@@ -2,8 +2,8 @@ require 'lightspeed_restaurant/base'
2
2
  require 'lightspeed_restaurant/operations/list'
3
3
  require 'lightspeed_restaurant/operations/create'
4
4
 
5
- module LightspeedRestaurant
6
- class CustomerCreditChange < LightspeedRestaurant::Base
5
+ module LightspeedRestaurantClient
6
+ class CustomerCreditChange < LightspeedRestaurantClient::Base
7
7
  include Operations::List
8
8
  include Operations::Create
9
9
 
@@ -1,4 +1,4 @@
1
- module LightspeedRestaurant
2
- class APIError < LightspeedRestaurantError
1
+ module LightspeedRestaurantClient
2
+ class APIError < LightspeedRestaurantClientError
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module LightspeedRestaurant
2
- class AuthenticationError < LightspeedRestaurantError
1
+ module LightspeedRestaurantClient
2
+ class AuthenticationError < LightspeedRestaurantClientError
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module LightspeedRestaurant
2
- class InvalidRequestError < LightspeedRestaurantError
1
+ module LightspeedRestaurantClient
2
+ class InvalidRequestError < LightspeedRestaurantClientError
3
3
  end
4
4
  end
@@ -1,5 +1,5 @@
1
- module LightspeedRestaurant
2
- class LightspeedRestaurantError < StandardError
1
+ module LightspeedRestaurantClient
2
+ class LightspeedRestaurantClientError < StandardError
3
3
  attr_reader :message
4
4
  attr_reader :http_status
5
5
  attr_reader :http_body
@@ -1,4 +1,4 @@
1
- module LightspeedRestaurant
2
- class NotFoundError < LightspeedRestaurantError
1
+ module LightspeedRestaurantClient
2
+ class NotFoundError < LightspeedRestaurantClientError
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module LightspeedRestaurant
2
- class UnauthorizedError < LightspeedRestaurantError
1
+ module LightspeedRestaurantClient
2
+ class UnauthorizedError < LightspeedRestaurantClientError
3
3
  end
4
4
  end
@@ -1,8 +1,8 @@
1
- module LightspeedRestaurant
1
+ module LightspeedRestaurantClient
2
2
  module Operations
3
3
  module Create
4
4
  def create(attributes)
5
- response = LightspeedRestaurant.post(resource_path, attributes)
5
+ response = LightspeedRestaurantClient.post(resource_path, attributes)
6
6
  payload = build_payload(attributes, response)
7
7
  return new(payload) if is_a?(Class)
8
8
 
@@ -1,8 +1,8 @@
1
- module LightspeedRestaurant
1
+ module LightspeedRestaurantClient
2
2
  module Operations
3
3
  module Destroy
4
4
  def destroy
5
- JSON.parse(LightspeedRestaurant.delete(self.class.resource_path + "/#{id}"))
5
+ JSON.parse(LightspeedRestaurantClient.delete(self.class.resource_path + "/#{id}"))
6
6
  self
7
7
  end
8
8
  end
@@ -1,8 +1,8 @@
1
- module LightspeedRestaurant
1
+ module LightspeedRestaurantClient
2
2
  module Operations
3
3
  module Find
4
4
  def find(id)
5
- response = JSON.parse(LightspeedRestaurant.get(resource_path + "/#{id}"))
5
+ response = JSON.parse(LightspeedRestaurantClient.get(resource_path + "/#{id}"))
6
6
  new(response)
7
7
  end
8
8
  end
@@ -1,8 +1,8 @@
1
- module LightspeedRestaurant
1
+ module LightspeedRestaurantClient
2
2
  module Operations
3
3
  module List
4
4
  def list(params = {})
5
- response = JSON.parse(LightspeedRestaurant.get(resource_path, {}, params))
5
+ response = JSON.parse(LightspeedRestaurantClient.get(resource_path, {}, params))
6
6
  results = response.is_a?(Array) ? response : response['results']
7
7
  instantiate(results)
8
8
  end
@@ -1,8 +1,8 @@
1
- module LightspeedRestaurant
1
+ module LightspeedRestaurantClient
2
2
  module Operations
3
3
  module Save
4
4
  def save
5
- LightspeedRestaurant.put(self.class.resource_path + "/#{id}", self)
5
+ LightspeedRestaurantClient.put(self.class.resource_path + "/#{id}", self)
6
6
  self
7
7
  end
8
8
  end
@@ -1,9 +1,9 @@
1
- module LightspeedRestaurant
1
+ module LightspeedRestaurantClient
2
2
  module Operations
3
3
  module Update
4
4
  def update(id, attributes)
5
5
  updated_object = new(attributes)
6
- LightspeedRestaurant.put(resource_path + "/#{id}", updated_object)
6
+ LightspeedRestaurantClient.put(resource_path + "/#{id}", updated_object)
7
7
  updated_object
8
8
  end
9
9
  end
@@ -1,8 +1,8 @@
1
1
  require 'lightspeed_restaurant/base'
2
2
  require 'lightspeed_restaurant/operations/list'
3
3
 
4
- module LightspeedRestaurant
5
- class Receipt < LightspeedRestaurant::Base
4
+ module LightspeedRestaurantClient
5
+ class Receipt < LightspeedRestaurantClient::Base
6
6
  extend Operations::List
7
7
 
8
8
  def self.resource_name
@@ -5,7 +5,7 @@ require 'lightspeed_restaurant/errors/invalid_request_error'
5
5
  require 'lightspeed_restaurant/errors/not_found_error'
6
6
  require 'uri'
7
7
 
8
- module LightspeedRestaurant
8
+ module LightspeedRestaurantClient
9
9
  class Request
10
10
  def initialize(base_uri, path, token, body = {}, query = {})
11
11
  @base_uri = base_uri || 'http://staging-exact-integration.posios.com'
@@ -1,3 +1,3 @@
1
- module LightspeedRestaurant
2
- VERSION = '0.3.0'.freeze
1
+ module LightspeedRestaurantClient
2
+ VERSION = '1.0.0'.freeze
3
3
  end
@@ -5,7 +5,7 @@ require 'lightspeed_restaurant/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'lightspeed_restaurant'
8
- spec.version = LightspeedRestaurant::VERSION
8
+ spec.version = LightspeedRestaurantClient::VERSION
9
9
  spec.authors = ['Olivier Buffon']
10
10
  spec.email = ['olivier@chronogolf.ca']
11
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lightspeed_restaurant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Buffon