Module: RDF::Util::UUID
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/lib/rdf/util/uuid.rb
Overview
Utilities for UUID handling.
Class Method Summary collapse
-
.generate(format: :default) ⇒ String
Generates a UUID string.
Class Method Details
.generate(format: :default) ⇒ String
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/lib/rdf/util/uuid.rb', line 21 def self.generate(format: :default) begin require 'uuid' ::UUID.generate(format) rescue LoadError begin require 'uuidtools' ::UUIDTools::UUID.random_create.hexdigest rescue LoadError raise LoadError.new("no such file to load -- uuid or uuidtools") end end end |