class WAB::UUID

The UUID class representing a 128 bit UUID although values are not validated for conformane to the ISO/IEC specifications.

Attributes

id[R]
to_s[R]

Public Class Methods

new(id) click to toggle source

Initializes a UUID from string representation of the UUID following the pattern “123e4567-e89b-12d3-a456-426655440000”.

# File lib/wab/uuid.rb, line 12
def initialize(id)
  @id = id.downcase
  raise WAB::ParseError.new('Invalid UUID format.') unless WAB::Utils.uuid_format?(@id)
end

Public Instance Methods

==(other) click to toggle source
# File lib/wab/uuid.rb, line 20
def ==(other)
  other.is_a?(self.class) && @id == other.id
end