LexicalUUID::UUID
Inherits Struct < Value < Object
Constructors
new(bytes : Bytes)
Sourcenew(bytes : String)
Sourcenew(timestamp : UInt64, worker_id : UInt64 = self.class.worker_id)
Sourcenew
SourceClass methods
create_worker_id
Sourceworker_id
SourceInstance 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
eql?(other)
Sourcefrom_bytes(bytes)
Sourcefrom_guid(guid)
Sourcehash
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.
timestamp
Sourcetimestamp=(timestamp : UInt64)
Sourceto_byte_array
Sourceto_bytes
Sourceto_guid
Sourceworker_id
Sourceworker_id=(worker_id : UInt64)
Source