Class: Unique
Overview
Unique creates unique variable names.
Class Method Summary collapse
-
.next ⇒ Object
Get the next unique variable name.
-
.reset ⇒ Object
Reset current count back to zero.
Class Method Details
.next ⇒ Object
Get the next unique variable name.
15 16 17 18 |
# File 'lib/unique.rb', line 15 def self.next @@curr += 1 "temp_#{@@curr}".intern end |
.reset ⇒ Object
Reset current count back to zero. Mainly used for testing.
8 9 10 |
# File 'lib/unique.rb', line 8 def self.reset @@curr = 0 end |