Sha256: 394fc3e4798fad3413bc7d8dbca329d37b4f6a977fe1fece3664753e889fbebb

Contents?: true

Size: 391 Bytes

Versions: 9

Compression:

Stored size: 391 Bytes

Contents

module Puggernaut
  class Server
    module Tcp

      include Logger
      
      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
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
puggernaut-0.2.3 lib/puggernaut/server/tcp.rb
puggernaut-0.2.2 lib/puggernaut/server/tcp.rb
puggernaut-0.2.1 lib/puggernaut/server/tcp.rb
puggernaut-0.2.0 lib/puggernaut/server/tcp.rb
puggernaut-0.1.5 lib/puggernaut/server/tcp.rb
puggernaut-0.1.4 lib/puggernaut/server/tcp.rb
puggernaut-0.1.3 lib/puggernaut/server/tcp.rb
puggernaut-0.1.2 lib/puggernaut/server/tcp.rb
puggernaut-0.1.0 lib/puggernaut/server/tcp.rb