Sha256: df963740807c430bdb12318ad2a9e94d66a2c403b5e73772649f6c48d0ef7d1c
Contents?: true
Size: 367 Bytes
Versions: 22
Compression:
Stored size: 367 Bytes
Contents
module Lopata module Id extend self def next(prefix = nil) id = "%d_%d" % [timestamp, seq_num] id = "%s_%s" % [prefix, id] if prefix id end def timestamp @timestamp ||= Time.now.strftime("%Y%m%d%H%M%S") end def seq_num @seq_num ||= 0 @seq_num += 1 @seq_num end end end
Version data entries
22 entries across 22 versions & 1 rubygems