Class: Colossus::SimpleWriterServer::FayeClientExtension

Inherits:
Object
  • Object
show all
Defined in:
lib/colossus/simple_writer_server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(writer_token = nil) ⇒ FayeClientExtension

Returns a new instance of FayeClientExtension.



55
56
57
# File 'lib/colossus/simple_writer_server.rb', line 55

def initialize(writer_token = nil)
  @writer_token = writer_token
end

Instance Attribute Details

#writer_tokenObject

Returns the value of attribute writer_token.



53
54
55
# File 'lib/colossus/simple_writer_server.rb', line 53

def writer_token
  @writer_token
end

Instance Method Details

#incoming(message, callback) ⇒ Object



59
60
61
# File 'lib/colossus/simple_writer_server.rb', line 59

def incoming(message, callback)
  callback.call(message)
end

#outgoing(message, callback) ⇒ Object



63
64
65
66
67
68
# File 'lib/colossus/simple_writer_server.rb', line 63

def outgoing(message, callback)
  message['ext'] ||= {}
  message['ext']['writer_token'] = writer_token

  callback.call(message)
end