Class: Colossus::WriterClient::FayeExtension
- Inherits:
-
Object
- Object
- Colossus::WriterClient::FayeExtension
- Defined in:
- lib/colossus/writer_client.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #incoming(message, callback) ⇒ Object
-
#initialize(token) ⇒ FayeExtension
constructor
A new instance of FayeExtension.
- #outgoing(message, callback) ⇒ Object
Constructor Details
#initialize(token) ⇒ FayeExtension
Returns a new instance of FayeExtension.
46 47 48 |
# File 'lib/colossus/writer_client.rb', line 46 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
44 45 46 |
# File 'lib/colossus/writer_client.rb', line 44 def token @token end |
Instance Method Details
#incoming(message, callback) ⇒ Object
50 51 52 |
# File 'lib/colossus/writer_client.rb', line 50 def incoming(, callback) callback.call() end |
#outgoing(message, callback) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/colossus/writer_client.rb', line 54 def outgoing(, callback) ['ext'] ||= {} ['ext']['writer_token'] = 'WRITER_TOKEN' callback.call() end |