struct Backend::Db::UserRole
- Backend::Db::UserRole
- Clear::Enum
- Struct
- Value
- Object
Defined in:
backend/db/user.cr:2backend/db/user.cr:4
Constant Summary
-
AUTHORIZED_VALUES =
{"teacher" => Teacher, "student" => Student}
-
Student =
UserRole.new("student")
-
Teacher =
UserRole.new("teacher")
Constructors
-
.from_api(role : Api::Schema::UserRole) : self
DB representation of the enum
Class Method Summary
- .all
-
.authorized_values
Return the list of authorized values
-
.from_string(str : String)
Return the enum with the string passed as parameter.
- .valid?(x)
Instance Method Summary
-
#to_api : Api::Schema::UserRole
API representation of the enum
Constructor Detail
Class Method Detail
def self.from_string(str : String)
#
Return the enum with the string passed as parameter. Throw Clear::IllegalEnumValueError if the string is not found.