Repository URL to install this package:
|
Version:
0.0.1 ▾
|
| lib |
| spec |
| .gitignore |
| Gemfile |
| Gemfile.lock |
| LICENSE.txt |
| README.md |
| Rakefile |
| deploy.rb |
| gingr.gemspec |
A Ruby wrapper for the Gingr REST API.
Add this line to your application's Gemfile:
gem 'gingr'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gingr
Before you can make calls to Gingr you must configure the library with a valid API key. You can request a token be generated by Gingr. The API key ties the API request to a particular Gingr company id.
There are two ways to configure the gem. You can pass a hash of configuration options when you create a client, or you can use a configure block. Key refers to any valid API key, company_app_name refers to the name of the company or company app which is used in the base url for calls to the Gingr API.
client = Gingr.client({api_key: "YOUR_TOKEN_HERE", company_app_name: 'company_app_name'})
Logging can also be enabled by passing an optional parameter
client = Gingr.client({api_token: "YOUR_TOKEN_HERE", logging: true})
Gingr.configure do |config| config.api_token = "YOUR_TOKEN_HERE" end client = Gingr.client
Currently two endpoints are supported, calls a list of owners or reservations for a particular company. Both require a date range passed in the parameters hash of the form: {start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD'}. This date range CANNOT be larger than 30 days or the API will simply return all records regardless of date range for a given entity.
Owners response = client.owners({start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD'})
Owner response = client.owner(id)
Reservations response = client.reservations({start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD'})
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)