Skip to content

Instantly share code, notes, and snippets.

@jbeasley6651
Created September 13, 2011 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbeasley6651/1214528 to your computer and use it in GitHub Desktop.
Save jbeasley6651/1214528 to your computer and use it in GitHub Desktop.
require 'pusher'
Pusher.app_id = 'APP ID'
Pusher.key = 'APP KEY'
Pusher.secret = 'APP SECRET'
def broadcast(event, channel, &block)
message = capture(&block)
Pusher[channel].trigger(event, message)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment