0.0
No commit activity in last 3 years
No release in over 3 years
Callback (http://callback.run) allows you to create a job that runs on a schedule and you get a webhook notification when the job should run. Stop building scheduling systems.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.5.0

Runtime

 Project Readme

Callback.run Ruby API Wrapper

Codeship Status for callbackrun/callback-ruby

Ruby bindings for the Callback.run API (http://developers.callback.run)

DESCRIPTION

Building scheduling systems takes precious cycles away from concentrating on the building business value. In addition, hosting costs increase to support running background jobs. Callback.run allows you to create recurring jobs that get scheduled and run on Callback's platform. When run, Callback will call a webhook on your servers.

This is a Ruby wrapper around the Callback.run API to easily integrate Callback in your Ruby applications.

INSTALLATION

gem install callback-ruby

Using Bunder, add the following to your Gemfile:

gem "callback-ruby"

BASIC USAGE

Configure the Client

You can configure Callback to use the API key for your team. If you are using Rails, you will want to create an initializer at config/initializers/callback.rb

require "callback"

Callback.configure do |config|
  config.access_token = ENV["CALLBACK_ACCESS_TOKEN"]
end

The following options are available for configuration:

Attribute Default
access_token nil
base_path https://api.callback.run

Creating a Client

There are several endpoints that hang off of the client. The first thing you want to do is create a client.

client = Callback::Client.new(access_token: "my_token")

If you leave the access_token option blank, it will use the access token specified when configuring the client.

Jobs

If you want to perform any CRUD operations on a job, you can use the jobs method off of the Client.

Creating a job

job = client.jobs.create(callback_url: "https://example.com/hooks/users/324/welcome",
                         payload: { account_id: 1234 })

Finding a job

job = client.jobs.find("https://example.com/hooks/users/324/welcome")

CONTRIBUTING

  1. Clone the repository git clone https://github.com/callbackrun/callback-ruby
  2. Create a feature branch git checkout -b my-awesome-feature
  3. Codez!
  4. Commit your changes (small commits please)
  5. Push your new branch git push origin my-awesome-feature
  6. Create a pull request hub pull-request -b callbackrun:master -h callbackrun:my-awesome-feature

Everyone interacting in Callback's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Callback code of conduct.

RELEASING A NEW GEM

  1. Bump the VERSION in lib/callback/version.rb
  2. Commit changes and push to GitHub
  3. run bundle exec rake release

LICENSE

This project is licensed under the MIT License.