DamirSvrtan/noodles

View on GitHub
lib/noodles/websocket/channel.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Noodles
  module Websocket
    class Channel
      # class << self
      #   attr_accessor :connections
      # end
      # self.connections = []

      def self.connections
        @@connections ||= []
      end

      def self.broadcast(msg)
        connections.each do |connection|
          connection.send_data msg
        end
      end


    end
  end
end