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-4.1.2 lib/cable_ready/channels.rb
cable_ready-4.1.1 lib/cable_ready/channels.rb
cable_ready-4.1.0 lib/cable_ready/channels.rb
cable_ready-4.0.9 lib/cable_ready/channels.rb
cable_ready-4.0.8 lib/cable_ready/channels.rb
cable_ready-4.0.7 lib/cable_ready/channels.rb
cable_ready-4.0.6 lib/cable_ready/channels.rb
cable_ready-4.0.5 lib/cable_ready/channels.rb
cable_ready-4.0.4 lib/cable_ready/channels.rb
cable_ready-4.0.3 lib/cable_ready/channels.rb
cable_ready-4.0.2 lib/cable_ready/channels.rb
cable_ready-4.0.1 lib/cable_ready/channels.rb
cable_ready-4.0.0 lib/cable_ready/channels.rb
cable_ready-3.0.1 lib/cable_ready/channels.rb
cable_ready-3.0.0 lib/cable_ready/channels.rb
cable_ready-2.0.8 lib/cable_ready/channels.rb
cable_ready-2.0.7 lib/cable_ready/channels.rb
cable_ready-2.0.6 lib/cable_ready/channels.rb
cable_ready-2.0.5 lib/cable_ready/channels.rb
cable_ready-2.0.4 lib/cable_ready/channels.rb