-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,12 @@ | |
[Lightspeed Restaurant API Client](https://github.com/chronogolf/lightspeed_restaurant) is a gem for interacting with [Lightspeed Restaurant](https://www.lightspeedhq.com/pos/restaurant/) API. | ||
Lightspeed Restaurant is point of sale that helps bars, restaurants, and cafés deliver a better customer experience and run a more profitable business. | ||
|
||
|
||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
|
||
```ruby | ||
gem 'lightspeed_restaurant' | ||
gem "lightspeed_restaurant" | ||
``` | ||
|
||
And then execute: | ||
|
@@ -28,23 +26,29 @@ Or install it yourself as: | |
### Basic Usage | ||
|
||
First, set your api token: | ||
|
||
```ruby | ||
LightspeedRestaurantClient.api_token = "YOUR_API_TOKEN_HERE" | ||
``` | ||
|
||
Next, make requests using the resource class you need: | ||
|
||
```ruby | ||
customers = LightspeedRestaurantClient::Customer.all | ||
customer = customers.first | ||
customer.firstName = 'Tom' | ||
customer.firstName = "Tom" | ||
customer.save | ||
``` | ||
That's it! | ||
|
||
That"s it! | ||
|
||
### Using a custom API configuration per action | ||
|
||
Each action support a configuration object as the last param, allows you to setup `api_token`, `base_uri` | ||
Sample usage: | ||
|
||
```ruby | ||
LightspeedRestaurantClient::Customer.all(LightspeedRestaurantClient.default_configuration.with(api_token: 'MY_OTHER_TOKEN', base_uri: 'other_ls_resto_uri')) | ||
LightspeedRestaurantClient::Customer.all(LightspeedRestaurantClient.default_configuration.with(api_token: "MY_OTHER_TOKEN", base_uri: "other_ls_resto_uri")) | ||
``` | ||
|
||
### Available operations | ||
|
@@ -56,28 +60,33 @@ LightspeedRestaurantClient::Customer.all | |
``` | ||
|
||
#### Find | ||
|
||
```ruby | ||
LightspeedRestaurantClient::Customer.find(123) | ||
``` | ||
|
||
#### Create | ||
|
||
```ruby | ||
LightspeedRestaurantClient::Customer.create(...firstName: 'Tom', email: '[email protected]'...) | ||
LightspeedRestaurantClient::Customer.create(...firstName: "Tom", email: "[email protected]"...) | ||
``` | ||
|
||
#### Update | ||
|
||
```ruby | ||
LightspeedRestaurantClient::Customer.update(123, { email: '[email protected]' }) | ||
LightspeedRestaurantClient::Customer.update(123, { email: "[email protected]" }) | ||
``` | ||
|
||
#### Save | ||
|
||
```ruby | ||
customer = LightspeedRestaurantClient::Customer.find(123) | ||
customer.firstName = 'Micheal' | ||
customer.firstName = "Micheal" | ||
customer.save | ||
``` | ||
|
||
#### Destroy | ||
|
||
```ruby | ||
customer = LightspeedRestaurantClient::Customer.find(123) | ||
customer.destroy | ||
|
@@ -87,6 +96,7 @@ customer.destroy | |
|
||
By default the logs are done on STDOUT. | ||
You can specify your own logger (it has to respond to info and error methods, like the Rails logger) : | ||
|
||
```ruby | ||
LightspeedRestaurantClient.logger = "YOUR_LOGGER" | ||
``` | ||
|
@@ -96,13 +106,15 @@ LightspeedRestaurantClient.logger = "YOUR_LOGGER" | |
Pull requests are welcome on GitHub at https://github.com/chronogolf/lightspeed_restaurant. | ||
|
||
## About Us | ||
|
||
[![Chronogolf by Lightspeed][crest]](https://www.lightspeedhq.com) | ||
|
||
[Chronogolf by Lightspeed](https://www.lightspeedhq.com/golf/)'s mission is to facilitate the interactions between golf managers and golf players. We are building software that allows golf directors to better manage their course, together with a marketplace to find & book games in real-time. We are constantly innovating and trying to challenge the status quo. | ||
|
||
Learn more at [https://www.lightspeedhq.com/golf/](https://www.lightspeedhq.com/golf/) | ||
|
||
## Future Improvements | ||
|
||
- Improve destroy operation to handle destroy by passing an ID (or an array of IDs) | ||
- Add missing resources (Company, Reservation, Floor, Table...) | ||
- Improve test coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module LightspeedRestaurantClient | ||
VERSION = '3.4.0' | ||
VERSION = "3.5.0" | ||
end |