Class: RailsChat::FayeExtension
- Inherits:
-
Object
- Object
- RailsChat::FayeExtension
- Defined in:
- lib/rails_chat/faye_extension.rb
Overview
This class is an extension for the Faye::RackAdapter. It is used inside of RailsChat.faye_app.
Instance Method Summary collapse
-
#incoming(message, callback) ⇒ Object
Callback to handle incoming Faye messages.
Instance Method Details
#incoming(message, callback) ⇒ Object
Callback to handle incoming Faye messages. This authenticates both subscribe and publish calls.
7 8 9 10 11 12 13 14 |
# File 'lib/rails_chat/faye_extension.rb', line 7 def incoming(, callback) if ["channel"] == "/meta/subscribe" authenticate_subscribe() elsif ["channel"] !~ %r{^/meta/} authenticate_publish() end callback.call() end |