claudiob / hubble_observatory

Hubble API client interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hubble Observatory

Hubble Observatory is a Ruby library to interact with the Hubble API.

The source code is available on GitHub and the documentation on RubyDoc.

Build Status Coverage Status Dependency Status Code Climate Online docs Gem Version

After registering your app, you can run commands like:

HubbleObservatory::TalentAccount.create email: 'user@example.com'
# => '123456'

The full documentation is available at rubydoc.info.

Installation and Configuration

Add this line to your application’s Gemfile:

gem 'hubble_observatory'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hubble_observatory

Set the following ENV variables in your Ruby/Rails application

ENV['HUBBLE_APP_TOKEN'] = "<app token to access Hubble API>"
ENV['HUBBLE_ENV'] = "production"

If you don’t set ENV['HUBBLE_ENV'] to "production", the staging Hubble API will be targeted.

How to use

Hubble Observatory provide only two methods to create and update talent accounts.

TalentAccount.create

Obtain the ID of Talent Account given the corresponding email:

talent_account = HubbleObservatory::TalentAccount.create email: 'user@example.com'
# => '123456'

TalentAccount#update

Update the email of a Talent Account give the corresponding ID:

talent_account = HubbleObservatory::TalentAccount.new id: '123456'
talent_account.update email: 'newuser@example.com'
# => '123456'

FsEmployee#create

Obtain the token of a employee given the appropriate access token:

HubbleObservatory::FsEmployee.create access_token: 'ya.29defg'
# => 'hb.484562'

How to develop and contribute

To install the app and its dependencies, run bin/setup.

To execute the test suite, run:

HUBBLE_APP_TOKEN=<token> bundle exec rake

To release a new version, run: bundle exec rake release.

About

Hubble API client interface

License:MIT License


Languages

Language:Ruby 98.8%Language:Shell 1.2%