Module: HashPersistent::Counter::ClassMethods

Defined in:
lib/hash-persistent/counter.rb

Instance Method Summary collapse

Instance Method Details

#next_keyObject



12
13
14
15
16
17
18
19
# File 'lib/hash-persistent/counter.rb', line 12

def next_key
  the_key = nil
  @key_inc_lock.synchronize do
    the_key = @next_key.to_s
    @next_key += 1
  end
  the_key
end