Class: Danthes::FayeExtension
- Inherits:
-
Object
- Object
- Danthes::FayeExtension
- Defined in:
- lib/danthes/faye_extension.rb
Overview
This class is an extension for the Faye::RackAdapter. It is used inside of Danthes.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/danthes/faye_extension.rb', line 7 def incoming(, callback) if ['channel'] == '/meta/subscribe' authenticate_subscribe() elsif ['channel'] !~ %r{^/meta/} authenticate_publish() end callback.call() end |