struct DppmRestApi::Config::GroupView

Overview

A Group view of an User, used to retrieve groups associated to an user.

Defined in:

config/group_view.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(user : User, all_groups : Array(Group)) #

[View source]

Instance Method Detail

def each_group(&) : Nil #

Yields each Group to the block for which the user is a member of.


[View source]
def find_group?(&) #

Yield each group to a block and return the first group for which the block returns a truthy value


[View source]
def groups : Array(Group) #

[View source]
def map_groups(&block : Group -> R) forall R #

yields each Group that the user is a member of to the block, and returns an Iterator of the results of the block. Important: if the result of the block is nil, it will be ignored (i.e. not a member of the resulting array) -- hence the resulting array can be of a different size than the number of groups of which this user is a member.


[View source]
def user : User #

[View source]