<img src=“https://travis-ci.org/corespring/corespring-ruby.svg” alt=“Travis CI”>
You can include the corespring-ruby
gem directly in your Gemfile
:
gem 'corespring', require: 'corespring-ruby'
See the ‘Examples’ section about specific API usage.
A command line interface is availably if you install the Gem manually:
$ gem install corespring
In conjunction with this, a +~/.corespring+ file can be used to store your credentials:
client_id = '553532167c7b5b155a660cc4' secret = '7t5cflvx4sc3ou1xhhoefmy5h'
You can obtain an API token using the token
action:
$ corespring token 8yomydfo7xxob63nlktxoomb1
You can encrypt options using the encrypt
action, specifying --options
as follows:
$ corespring encrypt --options "{\"mode\": \"gather\"}" 50d2cc461f10e4085e1fd23eb640f2ef--5bb672fadeb78c8139c7cc87dfbe3bcb
Create a new CoreSpring::APIClient
object with your client_id
and secret
:
client = CoreSpring::APIClient.new(client_id, secret)
client.get_token # 8yomydfo7xxob63nlktxoomb1
options = { mode: 'gather' } client.encrypt(options) # 130bb4b25f87afc1d825b35afb94596c--7ff4dc0e463b1b0a92705eacd36ac3ea
See the LICENSE.txt file for more information.