Class: Bunny::ConsumerTagGenerator
- Inherits:
-
Object
- Object
- Bunny::ConsumerTagGenerator
- Defined in:
- lib/bunny/consumer_tag_generator.rb
Overview
Used to generate consumer tags in the client
Instance Method Summary collapse
-
#generate ⇒ String
Generated consumer tag.
-
#generate_prefixed(name = "bunny") ⇒ String
Unique string supposed to be used as a consumer tag.
Instance Method Details
#generate ⇒ String
Returns Generated consumer tag
10 11 12 |
# 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") ⇒ String
Unique string supposed to be used as a consumer tag.
19 20 21 |
# 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 |