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