class Bunny::ConsumerTagGenerator
Used to generate consumer tags in the client
Public Instance Methods
generate()
click to toggle source
@return [String] Generated consumer tag
# File lib/bunny/consumer_tag_generator.rb, line 10 def generate "#{Kernel.rand}-#{Time.now.to_i * 1000}-#{Kernel.rand(999_999_999_999)}" end
generate_prefixed(name = "bunny")
click to toggle source
Unique string supposed to be used as a consumer tag.
@return [String] Unique string. @api public
# File lib/bunny/consumer_tag_generator.rb, line 19 def generate_prefixed(name = "bunny") "#{name}-#{Time.now.to_i * 1000}-#{Kernel.rand(999_999_999_999)}" end