Beaconpush
Beaconpush gem provides easy access to the Beacon push service from your application.
Usage
require "beaconpush"
# You may want to put these two lines inside of an initializer in
# your Rails application
Beaconpush.key = "ad819983"
Beaconpush.secret = "..."
# Beaconpush is ready to use now!
# Fetches the number of online users
Beaconpush.users_count
# => 2
# Checks if the user is online at the moment
Beaconpush.user_online?("alice")
# => false
# Sends the given message to the user
Beaconpush.("bob", "Hello Bob!")
# Fetches the list of online users in the given channel
Beaconpush.channel_users("myfirstchannel")
# => ["bob"]
# Sends the given message to the channel
Beaconpush.("myfirstchannel", :message => "Channel message!", :severity => "important")
# Forces the user to disconnect
Beaconpush.user_logout("bob")
# You can also use multiple Beacon accounts in a single application
client1 = Beaconpush::Client.new(:key => "da10749525", :secret => "...")
client2 = Beaconpush::Client.new(:key => "bb19021573", :secret => "...")
client1.users_count
# => 0
client2.users_count
# => 4
Installation
gem install beaconpush
Copyright
Copyright © 2010 Jakub Kuźma. Released on the MIT license (see LICENSE for details).