Sha256: f40ca984180f9fba4bee83a3eed226fa3c9aec455ffb104d03d668844d2156e2

Contents?: true

Size: 483 Bytes

Versions: 13

Compression:

Stored size: 483 Bytes

Contents

module Bunny
  class ConsumerTagGenerator

    #
    # API
    #

    # @return [String] Generated consumer tag
    def generate
      "#{Kernel.rand}-#{Time.now.to_i * 1000}-#{Kernel.rand(999_999_999_999)}"
    end # generate


    # Unique string supposed to be used as a consumer tag.
    #
    # @return [String]  Unique string.
    # @api public
    def generate_prefixed(name = "bunny")
      "#{name}-#{Time.now.to_i * 1000}-#{Kernel.rand(999_999_999_999)}"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bunny-0.9.0.pre13 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre12 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre11 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre10 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre9 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre8 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre7 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre6 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre5 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre4 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre3 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre2 lib/bunny/consumer_tag_generator.rb
bunny-0.9.0.pre1 lib/bunny/consumer_tag_generator.rb