Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
ducksboard ruby gem
Ruby
#8
branch: simple-slot-pu…

This branch is 13 commits ahead, 7 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
CHANGELOG.markdown
Gemfile
LICENSE
README.mdown
Rakefile
ducksboard.gemspec

README.mdown

Ducksboard API Ruby wrapper

Code Climate Build Status

Configuration

API Key can be set in the environment (such as ~/.bashrc).

export DUCKSBOARD_API_KEY='YOURKEY'

or in an initializer (such as config/initializers/ducksboard.rb)

Ducksboard.api_key = 'YOURKEY'

Sending Data (Push API)

Data can be sent to slots in formats specified in the Ducksboard API documentation.

# Update the value a slot (ie. counter)
slot = Ducksboard::Slot.new(123)
slot.update(:value => 20)

# Update a leaderboard
slot = Ducksboard::Slot.new("leaderboard")
slot.update(:value => {
  :boards => [
    {:name => "person 1", values => [123, 24.5]},
    {:name => "person 2", values => [224, 21.0]}
  ]
})

Pulling Data (Pull API)

Fetching data from a slot on Ducksboard. Several convinience methods are provided to fetch data through the Ducksboard HTTP Pull API. Each pull returns a hash of data with a data at response['data'].

slot = Ducksboard::Slot.new(123)
slot.last(:count => 15)

slot.since(:seconds => 5 * 60)

slot.timespan(:timespan => "weekly", :timezone => "UTC")
Something went wrong with that request. Please try again.