Class: ChannelHandlerStub
- Defined in:
- lib/volt/server/channel_handler_stub.rb
Class Method Summary collapse
- .dispatcher ⇒ Object
- .dispatcher=(val) ⇒ Object
-
.send_message_all(skip_channel = nil, *args) ⇒ Object
Sends a message to all, optionally skipping a users channel.
Instance Method Summary collapse
-
#initialize(channel_stub) ⇒ ChannelHandlerStub
constructor
A new instance of ChannelHandlerStub.
- #process_message(message) ⇒ Object
- #send_message(*args) ⇒ Object
Constructor Details
#initialize(channel_stub) ⇒ ChannelHandlerStub
Returns a new instance of ChannelHandlerStub.
10 11 12 13 |
# File 'lib/volt/server/channel_handler_stub.rb', line 10 def initialize(channel_stub) puts "INIT WITH : #{channel_stub.inspect}" @channel_stub = channel_stub end |
Class Method Details
.dispatcher ⇒ Object
6 7 8 |
# File 'lib/volt/server/channel_handler_stub.rb', line 6 def self.dispatcher @@dispatcher end |
.dispatcher=(val) ⇒ Object
2 3 4 |
# File 'lib/volt/server/channel_handler_stub.rb', line 2 def self.dispatcher=(val) @@dispatcher = val end |
.send_message_all(skip_channel = nil, *args) ⇒ Object
Sends a message to all, optionally skipping a users channel
16 17 18 |
# File 'lib/volt/server/channel_handler_stub.rb', line 16 def self.(skip_channel=nil, *args) # Stub end |
Instance Method Details
#process_message(message) ⇒ Object
20 21 22 23 |
# File 'lib/volt/server/channel_handler_stub.rb', line 20 def () puts "GOT: #{.inspect}" @@dispatcher.dispatch(self, ) end |
#send_message(*args) ⇒ Object
25 26 27 28 |
# File 'lib/volt/server/channel_handler_stub.rb', line 25 def (*args) puts "SEND MSG: #{args.inspect}" @channel_stub.(*args) end |