module Puggernaut class Server class Channel < EM::Channel attr_reader :channels, :user_id def initialize(channels, user_id) @channels = channels @user_id = user_id super() end class <= Time.now - 2 * 60 * 60 end hash[channel_name] = messages hash end @channels.each do |channel| next if exclude_user_id && channel.user_id == exclude_user_id push = channel.channels.collect do |channel_name| if messages[channel_name] messages[channel_name].collect { |message| "#{channel_name}|#{message.join('|')}" }.join("\n") end end push = push.compact unless push.empty? channel.push push.join("\n") end end end end end end end