Class: Gitlab::Utils::Uniquify
- Inherits:
-
Object
- Object
- Gitlab::Utils::Uniquify
- Defined in:
- lib/gitlab/utils/uniquify.rb
Instance Method Summary collapse
-
#initialize(counter = nil) ⇒ Uniquify
constructor
A new instance of Uniquify.
- #string(base) ⇒ Object
Constructor Details
#initialize(counter = nil) ⇒ Uniquify
Returns a new instance of Uniquify.
18 19 20 |
# File 'lib/gitlab/utils/uniquify.rb', line 18 def initialize(counter = nil) @counter = counter end |
Instance Method Details
#string(base) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/gitlab/utils/uniquify.rb', line 22 def string(base) @base = base increment_counter! while yield(base_string) base_string end |