Ruby client library for the Starter League Portal API
Add this line to your application's Gemfile:
gem 'portal_client', :git => 'git://github.com/starterleague/portal_client.git'
And then execute:
$ bundle
Configure the client with your OAuth APP_ID and SECRET
PortalClient.configure do |config|
config.app_id = APP_ID
config.secret = SECRET
config.cache_store = Rails.cache
end
Note the optional cache_store config option. You can pass a reference
to any ActiveSupport::Cache compatible cache store.
Then, create a client instance with an authorized user's ACCESS_TOKEN
@client = PortalClient::Client.new(ACCESS_TOKEN)
Now, you can make calls to the API thru your client instance
years = @client.years
or
year = @client.year(2012)
quarters = @client.quarters
or
quarter = @client.quarter(QUARTER_ID)
courses = @client.courses
or
course = @client.course(COURSE_ID)
user = @client.users.current_user
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request