Class: Faye::Authentication::ClientExtension
- Inherits:
-
Object
- Object
- Faye::Authentication::ClientExtension
- Defined in:
- lib/faye/authentication/client_extension.rb
Instance Method Summary collapse
-
#initialize(secret, options = {}) ⇒ ClientExtension
constructor
A new instance of ClientExtension.
- #outgoing(message, callback) ⇒ Object
Constructor Details
#initialize(secret, options = {}) ⇒ ClientExtension
Returns a new instance of ClientExtension.
5 6 7 8 |
# File 'lib/faye/authentication/client_extension.rb', line 5 def initialize(secret, = {}) @secret = secret @options = end |
Instance Method Details
#outgoing(message, callback) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/faye/authentication/client_extension.rb', line 10 def outgoing(, callback) if Faye::Authentication.authentication_required?(, @options) ['signature'] = Faye::Authentication.sign({channel: ['subscription'] || ['channel'], clientId: ['clientId']}, @secret, @options) end callback.call() end |