Class: URI::URN::UUID
Constant Summary collapse
- NSS_PATTERN =
"[#{PATTERN::HEX}]{8}-[#{PATTERN::HEX}]{4}-[#{PATTERN::HEX}]{4}-[#{PATTERN::HEX}]{4}-[#{PATTERN::HEX}]{12}".freeze
Constants inherited from Generic
Generic::COMPONENT, Generic::NID_PATTERN, Generic::PATTERN, Generic::URN_CHARS_PATTERN, Generic::URN_REGEXP
Instance Attribute Summary
Attributes inherited from Generic
Class Method Summary collapse
-
.generate ⇒ Object
Generate UUID and build URI::URN::UUID with it.
Instance Method Summary collapse
Methods inherited from Generic
Constructor Details
This class inherits a constructor from URI::URN::Generic
Class Method Details
.generate ⇒ Object
Generate UUID and build URI::URN::UUID with it
Currently only version 4 is supported
15 16 17 18 |
# File 'lib/uri/urn/uuid.rb', line 15 def self.generate require 'securerandom' unless defined? SecureRandom build(nss: SecureRandom.uuid) end |
Instance Method Details
#normalize! ⇒ Object
20 21 22 23 |
# File 'lib/uri/urn/uuid.rb', line 20 def normalize! super set_nss(self.nss.downcase) end |