Sha256: 5c81c88a5d554a025689b44e26a3b2dfdb415f06916daf9a0b8741b7b5dc264b

Contents?: true

Size: 345 Bytes

Versions: 11

Compression:

Stored size: 345 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 = Faye.random
      name = Faye.random while @used.has_key?(name)
      @used[name] = name
    end
    
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
faye-0.7.2 lib/faye/util/namespace.rb
faye-0.6.8 lib/faye/util/namespace.rb
faye-0.7.1 lib/faye/util/namespace.rb
faye-0.7.0 lib/faye/util/namespace.rb
faye-0.6.7 lib/faye/util/namespace.rb
faye-0.6.6 lib/faye/util/namespace.rb
faye-0.6.5 lib/faye/util/namespace.rb
faye-0.6.4 lib/faye/util/namespace.rb
faye-0.6.3 lib/faye/util/namespace.rb
faye-0.6.2 lib/faye/util/namespace.rb
faye-0.6.1 lib/faye/util/namespace.rb