Sha256: 3d9b42e467e04919032c76638e3ac8f6a5be51dd3e984e51b001f5e2dd44bd68

Contents?: true

Size: 350 Bytes

Versions: 23

Compression:

Stored size: 350 Bytes

Contents

require_relative "channel"

module CableReady
  class Channels
    def initialize
      @channels = {}
    end

    def [](channel_name)
      @channels[channel_name] ||= CableReady::Channel.new(channel_name)
    end

    def clear
      @channels = {}
    end

    def broadcast
      @channels.values.map(&:broadcast)
      clear
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
cable_ready-2.0.3 lib/cable_ready/channels.rb
cable_ready-2.0.2 lib/cable_ready/channels.rb
cable_ready-2.0.1 lib/cable_ready/channels.rb