Class: RelaxDB::UuidGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/relaxdb/uuid_generator.rb

Class Method Summary collapse

Class Method Details

.id_length=(length) ⇒ Object

 Convenience that helps relationship debuggging and model exploration



15
16
17
# File 'lib/relaxdb/uuid_generator.rb', line 15

def self.id_length=(length)
  @length = length
end

.uuidObject



5
6
7
8
9
10
11
12
# File 'lib/relaxdb/uuid_generator.rb', line 5

def self.uuid
  unless @length
    @uuid ||= UUID.new 
    @uuid.generate
  else
    rand.to_s[2, @length]
  end
end