Skip to content

invisiblecloud/invisible-collector-ruby

Repository files navigation

Invisible Collector API Ruby client

Gem Version Travis Badge Code Climate

Installation

Add this line to your application's Gemfile:

gem 'invisible_collector'

And then execute:

$ bundle

Or install it yourself as:

$ gem install invisible_collector

Usage

If necessary include it in you ruby code:

require 'invisible_collector'

You'll need to retrieve an access token from Invisible Collector's dashboard.

With your access token you can instantiate a new client with it:

client = InvisibleCollector::API.new(api_token: 'YOUR_TOKEN')

Resources

Company resource

client = InvisibleCollector::API.new(api_token: 'YOUR_TOKEN')
client.company #=> InvisibleCollector::CompanyResource

Actions supported:

  • client.company.get()

Customer resource

client = InvisibleCollector::API.new(api_token: 'YOUR_TOKEN')
client.customer #=> InvisibleCollector::CustomerResource

Actions supported:

  • client.customer.find(:attribute_hash)
  • client.customer.get(:id)
  • client.customer.update(:attribute_hash)
  • client.customer.debts(:id)

Debt resource

client = InvisibleCollector::API.new(api_token: 'YOUR_TOKEN')
client.debt #=> InvisibleCollector::DebtResource

Actions supported:

  • client.debt.find(:attribute_hash)
  • client.debt.get(:id)
  • client.debt.save(:attribute_hash)
  • client.debt.cancel(:debt)
  • client.debt.suspend(:debt)
  • client.debt.unsuspend(:debt)

Alarm resource

client = InvisibleCollector::API.new(api_token: 'YOUR_TOKEN')
client.alarm #=> InvisibleCollector::AlarmResource

Actions supported:

  • client.alarm.close(:id)
  • client.alarm.get(:id)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

License

The gem is available as open source under the terms of the MIT License.

Packages

 
 
 

Contributors