Class: Unique

Inherits:
Object show all
Defined in:
lib/unique.rb

Overview

Unique creates unique variable names.

Class Method Summary collapse

Class Method Details

.nextObject

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

.resetObject

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