Dead-simple Ruby API client for workable.com. No extra runtime dependencies. Ruby >= 1.9.3.
Uses v2 API provided by workable.
Add this line to your application's Gemfile:
gem 'workable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install workable
Internal interface / api is in early stage, so far you can:
- fetch jobs
- fetch job details
- fetch candidates for given job
Example:
client = Workable::Client.new(api_key: 'api_key', subdomain: 'your_subdomain')
# takes optional phase argument (string): 'published' (default), 'draft', 'closed' or 'archived'
client.jobs # => [#<Workable::Job>, #<Workable::Job>]
shortcode = 'job_shortcode'
# API queries are not cached (at all) - it's up to you to cache results one way or another
client.stages # => Array of hashes
client.job_details(shortcode) # => #<Workable::Job>
client.job_questions(shortcode) # => Array of hashes
client.job_candidates(shortcode, stage_slug) # => Array of hashes (skip stage_slug for all stages)
# Possible errors (each one inherits from Workable::Errors::WorkableError)
Workable::Errors::InvalidConfiguration # missing api_key / subdomain
Workable::Errors::NotAuthorized # wrong api key
Workable::Errors::InvalidResponse # something when wrong during the request?
Workable::Errors::NotFound # 404 from workable
Workable::Errors::RequestToLong # When the requested result takes to long to calculate, try limiting your query
Pull requests are welcomed. So far this gem does not provide:
- candidates import
- some sane way for parsing candidates json response
(Personally I don't really need/use it)
- Fork it ( https://github.com/emq/workable/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request