Crystal Easy · Lesson 2

Enums and flags

Declare enums with named values, read .value, compare with predicates like red?, parse strings, add methods, and combine @[Flags] members.

Lessons · Crystal Easy · Lesson 2 of 10

Enums and flags

Declare enums with named values, read .value, compare with predicates like red?, parse strings, add methods, and combine @[Flags] members.

Illustration for Crystal
Declare enums with named values, read .value, compare with predicates like red?, parse strings, add methods, and combine @[Flags] members.