class Dbd::Helpers::UUID
A simple UUID
implementation based on SecureRandom.
Public Class Methods
new()
click to toggle source
Store a SecureRandom.uuid. @return [void]
# File lib/dbd/helpers/uuid.rb, line 20 def initialize @uuid = SecureRandom.uuid.encode('utf-8') end
valid_regexp()
click to toggle source
A regexp that can be used in tests. @return [Regexp]
# File lib/dbd/helpers/uuid.rb, line 13 def self.valid_regexp /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\Z/ end
Public Instance Methods
to_s()
click to toggle source
The to_s
of the uuid. @return [String]
# File lib/dbd/helpers/uuid.rb, line 27 def to_s @uuid end