The UUID
class handles representing a universally unique
identifier.
# Create a new unique UUID. @uuid = Rubeyond::UUID.create # Create an instance of UUID from a uuid value. @uuid = Rubeyond::UUID.create :uuid => "fd0289a5-8eec-4a08-9283-81d02c9d2fff" # Create an instance of UUID from an encoded value. @uuid = Rubeyond::UUID.create :encoded => 336307859334295828133695192821923655679
The encoded value of the UUID
.
A string representation of the UUID
.
Creates a new UUID
instance.
If provided, it will create a new instances with the given uuid value.
options
- creation options
+:uuid: - the UUID
value to use
+:encoded: - an encoded UUID
# File lib/rubeyond/uuid.rb, line 55 def self.create(options = {}) # if we have a uuid then create from that if options[:uuid] Rubeyond::UUID.new(options[:uuid]) elsif options[:encoded] uuid = decode(options[:encoded]) Rubeyond::UUID.new(uuid) else Rubeyond::UUID.new end end
Returns a string representation of the UUID.
# File lib/rubeyond/uuid.rb, line 84 def to_s @uuid end