Crystal · Lesson 4

Methods: defaults, named args, overloads

Define methods with def, return the last expression, add type restrictions, defaults and named arguments, and overload by type.

Lessons · Crystal · Lesson 4 of 10

Methods: defaults, named args, overloads

Define methods with def, return the last expression, add type restrictions, defaults and named arguments, and overload by type.

Illustration for Crystal
Define methods with def, return the last expression, add type restrictions, defaults and named arguments, and overload by type.