class ULID
- ULID
- Reference
- Object
Overview
this implements ULID generation, as defined at https://github.com/ulid/spec
Included Modules
- Comparable(ULID)
Defined in:
ulid.crConstructors
Class Method Summary
- .monotonic_string(seed_time : Time = Time.utc)
- .monotonic_uint(seed_time : Time = Time.utc)
- .monotonic_ulid(seed_time : Time = Time.utc)
- .monotonic_uuid(seed_time : Time = Time.utc)
- .string(seed_time : Time = Time.utc)
- .uint(seed_time : Time = Time.utc)
- .ulid(seed_time : Time = Time.utc)
- .uuid(seed_time : Time = Time.utc)
Instance Method Summary
-
#<=>(other : ULID)
implementing <=> and including Comparable will give us == for free
-
#hash(hasher)
Define a hash(hasher) method based on @value Between #hash and #==, we can use ULID objects as values in Hashes
- #to_i : UInt128
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #to_u128 : UInt128
- #to_uuid
- #value : UInt128
- #value=(value : UInt128)
Constructor Detail
Class Method Detail
Instance Method Detail
implementing <=> and including Comparable will give us == for free
def hash(hasher)
#
Define a hash(hasher) method based on @value Between #hash and #==, we can use ULID objects as values in Hashes
def to_s(io : IO) : Nil
#
Description copied from class Reference
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>