Module: EventMachine::UuidGenerator

Defined in:
lib/pr_eventmachine.rb

Overview

Factored out so we can substitute other implementations here if desired, such as the one in ActiveRBAC.

Class Method Summary collapse

Class Method Details

.generateObject



238
239
240
241
242
243
244
245
246
247
248
# File 'lib/pr_eventmachine.rb', line 238

def self.generate
  if @ix and @ix >= 10000
    @ix = nil
    @seed = nil
  end

  @seed ||= `uuidgen`.chomp.gsub(/-/,"")
  @ix ||= 0

  "#{@seed}#{@ix += 1}"
end