struct

LexicalUUID::UUID

Inherits Struct < Value < Object

Constructors

new(bytes : Bytes)
Source
new(bytes : String)
Source
new(timestamp : UInt64, worker_id : UInt64 = self.class.worker_id)
Source

Class methods

create_worker_id
Source
worker_id
Source

Instance methods

<=>(other)
Source
==(other)

Returns true if this struct is equal to other.

Both structs' instance vars are compared to each other. Thus, two structs are considered equal if each of their instance variables are equal. Subclasses should override this method to provide specific equality semantics.

struct Point
  def initialize(@x : Int32, @y : Int32)
  end
end

p1 = Point.new 1, 2
p2 = Point.new 1, 2
p3 = Point.new 3, 4

p1 == p2 # => true
p1 == p3 # => false
Source
eql?(other)
Source
from_bytes(bytes)
Source
from_guid(guid)
Source
hash

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with == by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.

Source
timestamp
Source
timestamp=(timestamp : UInt64)
Source
to_byte_array
Source
to_bytes
Source
to_guid
Source
worker_id
Source
worker_id=(worker_id : UInt64)
Source