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



234
235
236
237
238
239
240
241
242
243
244
# File 'lib/pr_eventmachine.rb', line 234

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

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

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