7
8
9
10
11
12
13
14
15
16
|
# File 'lib/puggernaut/server/tcp.rb', line 7
def receive_data(data)
messages = data.split("\n").inject({}) do |hash, line|
channel, message = line.split('|', 2)
hash[channel] ||= []
hash[channel] << message
hash
end
Channel.say messages
send_data "OK\n"
end
|