Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  lib
  spec
  .gitignore
  Gemfile
  Gemfile.lock
  LICENSE.txt
  README.md
  Rakefile
  deploy.rb
  gingr.gemspec
Size: Mime:
  README.md

Gingr

A Ruby wrapper for the Gingr REST API.

Installation

Add this line to your application's Gemfile:

gem 'gingr'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gingr

Usage

Configuration

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

Endpoints

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'})

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request