Class: RelaxDB::UuidGenerator
- Inherits:
-
Object
- Object
- RelaxDB::UuidGenerator
- Defined in:
- lib/relaxdb/uuid_generator.rb
Class Method Summary collapse
-
.id_length=(length) ⇒ Object
Convenience that helps relationship debuggging and model exploration.
- .uuid ⇒ Object
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 |
.uuid ⇒ Object
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 |