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.
66 67 68 |
# File 'lib/colossus/writer_client.rb', line 66 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
64 65 66 |
# File 'lib/colossus/writer_client.rb', line 64 def token @token end |
Instance Method Details
#incoming(message, callback) ⇒ Object
70 71 72 |
# File 'lib/colossus/writer_client.rb', line 70 def incoming(, callback) callback.call() end |
#outgoing(message, callback) ⇒ Object
74 75 76 77 78 79 |
# File 'lib/colossus/writer_client.rb', line 74 def outgoing(, callback) ['ext'] ||= {} ['ext']['writer_token'] = 'WRITER_TOKEN' callback.call() end |