class System::User
inherits Reference
¶
Represents a user on the host system.
Users can be retrieved by either username or their user ID:
require "system/user"
System::User.find_by name: "root"
System::User.find_by id: "0"
Extended modules
Crystal::System::User
Class methods¶
.find_by(*, name : String)
¶
(*, name : String)
Returns the user associated with the given username.
Raises NotFoundError
if no such user exists.
.find_by(*, id : String)
¶
(*, id : String)
Returns the user associated with the given ID.
Raises NotFoundError
if no such user exists.
.find_by?(*, name : String)
¶
(*, name : String)
Returns the user associated with the given username.
Returns nil
if no such user exists.
.find_by?(*, id : String)
¶
(*, id : String)
Returns the user associated with the given ID.
Returns nil
if no such user exists.
Methods¶
#==(other : self)
¶
(other : self)
Returns true
if this reference is the same as other. Invokes same?
.
#hash(hasher)
¶
(hasher)