Module: IdGenerator

Defined in:
lib/id_generator.rb

Class Method Summary collapse

Class Method Details

.build(prefix = nil) ⇒ Object



2
3
4
5
6
# File 'lib/id_generator.rb', line 2

def self.build(prefix = nil)
  id = (Time.new.to_f * 10000000).to_s.gsub('.', '')

  prefix ? "#{prefix}-#{id}" : id
end