Celery
A Ruby gem for interacting with the Celery API.
Installation
Add this line to your application's Gemfile:
gem 'celery'
And then execute:
bundle
Or install it yourself as:
gem install celery
Usage
To get started, you'll need to create a Celery account to get your API access token.
require 'celery'
celery = Celery::API.new ('CELERY_API_TOKEN')
# Also looks in ENV['CELERY_API_TOKEN']
# celery = Celery::API.new
coupons = celery.coupon.all
# => {"total"=>0, "count"=>0, "limit"=>0, "offset"=>0, "has_more"=>false, "coupons"=>[]}
orders = celery.order.all(limit: 100, skip: 2, sort: 'created')
# => {"total"=>0, "count"=>0, "limit"=>100, "offset"=>2, "has_more"=>false, "orders"=>[]}
me = celery.user.me
me['user']['name']
# => "Joe Public"
Contributing
- Fork it
- 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 new Pull Request