ChartMogul API Ruby Client
Ruby Shell
Latest commit cdd0a76 Jan 6, 2017 @promulo promulo committed on GitHub Support new endpoints and move Customer, Plan and Data Sources outsid…
…e of Import namespace (#32)

* Add support for retrieving data sources by UUID

* Add support for retrieving a plan by UUID

* Add support for updating a plan

* Add support for deleting a plan

* Move Customer, Plan and DataSource outside of Import namespace

* Remove unused test cassettes

* Update references in other tests/cassettes

* Update changelog

* Use hardcoded UUID in specs

README.md

Official ChartMogul API Ruby Client

chartmogul-ruby provides convenient Ruby bindings for ChartMogul's API.

Gem Version Travis project


Installation | Configuration | Usage | Development | Contributing | License



Installation

Add this line to your application's Gemfile:

gem 'chartmogul-ruby', require: 'chartmogul'

And then execute:

$ bundle

Or install it yourself as:

$ gem install chartmogul-ruby

Configuration

Configure chartmogul-ruby with your Account Token and Secret Key, available from the administration section of your ChartMogul account.

ChartMogul.account_token = '<Account key goes here>'
ChartMogul.secret_key = '<Secret key goes here>'

Usage

For example, to create a Data Source object,

Request:

ChartMogul::Import::DataSource.create!(
  name: 'In-house billing'
)

Response:

#<ChartMogul::Import::DataSource:0x007ff9f127d628 
@name="In-house billing", 
@uuid="ds_cfc2b8f2-ad2c-4e3d-b64f-58d0bb282824", 
@status="never_imported", 
@created_at=2016-06-27 11:27:37 UTC
>

You can find examples for each endpoint in the ChartMogul API documentation.

https://gyazo.com/f7a2a1b86a409586ee8dd0f4f7563937

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.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/chartmogul/chartmogul-ruby.

License

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

The MIT License (MIT)

Copyright (c) 2016 ChartMogul Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.