Summary
In this chapter, you learned how to create classes and structs, understanding their differences. It became clear that every single value is an object – even classes themselves are objects: objects hold data and can be manipulated with methods. You saw how to inherit and extend classes and how to create reusable modules to organize your code. Finally, you learned about exceptions and how to use classes to create a custom type of error. As a heavily object-oriented language, you will interact with objects on pretty much every line of code. Knowing how to define your own classes is an essential skill for writing Crystal programs.
In the next chapter, we'll jump into solving more practical problems using the Crystal language by writing some tools for the command-line interface (CLI).