Repository URL to install this package:
|
Version:
0.0.9 ▾
|
| lib |
| spec |
| .gitignore |
| Gemfile |
| Gemfile.lock |
| LICENSE.txt |
| README.md |
| Rakefile |
| service_titan.gemspec |
A Ruby wrapper for the ServiceTitan REST API.
Add this line to your application's Gemfile:
gem 'service_titan'
And then execute:
$ bundle
Or install it yourself as:
$ gem install service_titan
Before you can make calls to ServiceTitan you must configure the library with a valid API Token. You can request a token be generated by ServiceTitan. The API Token ties the API request to a particular ServiceTitan 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.
client = ServiceTitan.client({api_key: "YOUR_TOKEN_HERE"})
ServiceTitan.configure do |config| config.api_key = "YOUR_TOKEN_HERE" end
client = ServiceTitan.client
client = ServiceTitan.client({api_key: "YOUR_TOKEN_HERE", logger = nil})
Logging can also be enabled by passing an optional logger.
Examples
in a rails application logger = Rails.logger
with a custom logger logger = Logger.new("test.log")
client = ServiceTitan.client({api_key: "YOUR_TOKEN_HERE", logger = logger})
client.customers => return a list of customers
client.invoices => return a list of invoices
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)