Class: CisRailsChat::FayeExtension
- Inherits:
-
Object
- Object
- CisRailsChat::FayeExtension
- Defined in:
- lib/cis_rails_chat/faye_extension.rb
Overview
This class is an extension for the Faye::RackAdapter. It is used inside of CisRailsChat.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/cis_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 |