class

System::Group

Inherits Crystal::System::Group / Reference / Object

Represents a group of users on the host system.

NOTE: To use Group, you must explicitly import it with require "system/group"

Groups can be retrieved by either group name or their group ID:

require "system/group"

System::Group.find_by name: "staff"
System::Group.find_by id: "0"

Class methods

find_by(*, name : String) : System::Group

Returns the group associated with the given name.

Raises NotFoundError if no such group exists.

Source
find_by(*, id : String) : System::Group

Returns the group associated with the given ID.

Raises NotFoundError if no such group exists.

Source
find_by?(*, name : String) : System::Group | Nil

Returns the group associated with the given name.

Returns nil if no such group exists.

Source
find_by?(*, id : String) : System::Group | Nil

Returns the group associated with the given ID.

Returns nil if no such group exists.

Source

Instance methods

==(other : self)

Returns true if this reference is the same as other. Invokes same?.

hash(hasher)

See Object#hash(hasher)

id

The group's identifier.

Source
name

The group's name.

Source
to_s(io)
Source

Nested types