struct Backend::Db::UserRole

Defined in:

backend/db/user.cr:2
backend/db/user.cr:4

Constant Summary

AUTHORIZED_VALUES = {"teacher" => Teacher, "student" => Student}
Student = UserRole.new("student")
Teacher = UserRole.new("teacher")

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.from_api(role : Api::Schema::UserRole) : self #

DB representation of the enum


Class Method Detail

def self.all #

def self.authorized_values #

Return the list of authorized values


def self.from_string(str : String) #

Return the enum with the string passed as parameter. Throw Clear::IllegalEnumValueError if the string is not found.


def self.valid?(x) #

Instance Method Detail

def to_api : Api::Schema::UserRole #

API representation of the enum