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



153
154
155
156
157
158
159
160
161
162
163
# File 'lib/pr_eventmachine.rb', line 153

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

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

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