Sha256: ed7f902e41315b2929c738f97661d08cd0313d2ba56dd9e56c0072844018597e

Contents?: true

Size: 456 Bytes

Versions: 4

Compression:

Stored size: 456 Bytes

Contents

require 'active_support/hash_with_indifferent_access'

module WebsocketRails

  class << self

    def channel_manager
      @channel_manager ||= ChannelManager.new
    end

    def [](channel)
      channel_manager[channel]
    end

  end

  class ChannelManager

    attr_reader :channels

    def initialize
      @channels = HashWithIndifferentAccess.new
    end

    def [](channel)
      @channels[channel] ||= Channel.new channel
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
websocket-rails-0.3.0 lib/websocket_rails/channel_manager.rb
websocket-rails-0.2.1 lib/websocket_rails/channel_manager.rb
websocket-rails-0.2.0 lib/websocket_rails/channel_manager.rb
websocket-rails-0.1.9 lib/websocket_rails/channel_manager.rb