Skip to content

ScaleDrone/scaledrone-ruby

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 

Scaledrone Ruby API

Official ScaleDrone Ruby pushing library. This is a wrapper around the REST API.

Installation

Add this line to your application's Gemfile:

gem 'scaledrone'

And then execute:

bundle install

Or install it directly:

gem install 'scaledrone'

Usage

Create a new instance of ScaleDrone passing it the channelId and secretKey that you can find from the channel's page

require 'scaledrone'

sd = ScaleDrone.new({
  channel_id: 'G3TYvCzoXtrIuEtQ',
  secret_key: 'M7Oc1DY2FgkCaUh4aQFC3TRV1R3RThPd'
})

Publishing a message

Please notice that in 1.0.0 the function header changed, when upgrading from 0.X.X you need to switch message and room order.

room = 'notifications'
message = {foo: 'bar'}
response = sd.publish(message, room)

Publishing the same message to multiple rooms

rooms = ['notifications', 'lounge']
message = {foo: 'bar'}
response = sd.publish(message, *rooms)

Channel stats

response = sd.channel_stats()

Connected users list

response = sd.users_list()

About

Ruby library for Scaledrone Realtime Messaging Service

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages