W3cubDocs

/Crystal

class System::Group

Overview

Represents a group of users on the host system.

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"

Extended Modules

Defined in:

system/group.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.find_by(*, name : String)Source

Returns the group associated with the given name.

Raises NotFoundError if no such group exists.

def self.find_by(*, id : String)Source

Returns the group associated with the given ID.

Raises NotFoundError if no such group exists.

def self.find_by?(*, name : String)Source

Returns the group associated with the given name.

Returns nil if no such group exists.

def self.find_by?(*, id : String)Source

Returns the group associated with the given ID.

Returns nil if no such group exists.

Instance Method Detail

def ==(other : self)

Description copied from class Reference

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

def hash(hasher)

Description copied from class Reference

See Object#hash(hasher)

def id : StringSource

The group's identifier.

def name : StringSource

The group's name.

def to_s(io)Source

© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/System/Group.html