Sha256: 5654bd205658be37975151753802cd95893738b23b4590847782f6c66cc9f6d0

Contents?: true

Size: 332 Bytes

Versions: 16

Compression:

Stored size: 332 Bytes

Contents

module Faye
  class Namespace

    extend Forwardable
    def_delegator :@used, :delete, :release
    def_delegator :@used, :has_key?, :exists?

    def initialize
      @used = {}
    end

    def generate
      name = Engine.random
      name = Engine.random while @used.has_key?(name)
      @used[name] = name
    end

  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
faye-1.4.0 lib/faye/util/namespace.rb
faye-1.3.0 lib/faye/util/namespace.rb
faye-1.2.5 lib/faye/util/namespace.rb
faye-1.1.3 lib/faye/util/namespace.rb
faye-1.2.4 lib/faye/util/namespace.rb
faye-1.2.3 lib/faye/util/namespace.rb
faye-1.2.2 lib/faye/util/namespace.rb
faye-1.2.1 lib/faye/util/namespace.rb
faye-1.2.0 lib/faye/util/namespace.rb
faye-ouvrages-1.1.2.1 lib/faye/util/namespace.rb
faye-ouvrages-1.1.2 lib/faye/util/namespace.rb
faye-1.1.2 lib/faye/util/namespace.rb
faye-1.1.1 lib/faye/util/namespace.rb
faye-1.1.0 lib/faye/util/namespace.rb
faye-huboard-1.0.5 lib/faye/util/namespace.rb
faye-huboard-1.0.4 lib/faye/util/namespace.rb