module Identifier::UUID
Public Class Methods
format(uuid)
click to toggle source
# File lib/identifier/uuid/uuid.rb, line 3 def self.format(uuid) uuid.to_s end
parse(text)
click to toggle source
# File lib/identifier/uuid/uuid.rb, line 16 def self.parse(text) uuid = text.match(pattern).to_s uuid = nil if uuid == '' uuid end
pattern()
click to toggle source
# File lib/identifier/uuid/uuid.rb, line 22 def self.pattern Pattern::TYPE_4 end
random()
click to toggle source
# File lib/identifier/uuid/uuid.rb, line 7 def self.random Random.get end
uuid?(text)
click to toggle source
# File lib/identifier/uuid/uuid.rb, line 11 def self.uuid?(text) uuid = parse(text) uuid == text end
zero()
click to toggle source
# File lib/identifier/uuid/uuid.rb, line 26 def self.zero '00000000-0000-0000-0000-000000000000' end