This chapter covered a lot of important concepts. This chapter's primary goal was to examine how OOP can be utilized to limit duplicate code and share core functionality between subclasses. Initially, we walked through a real-world example of OOP and saw how to implement setters and getters in Ruby classes. You looked at the concept of instantiation and learned the initialize method in Ruby, including its syntax, when it can be helpful to use, and various options you can pass to it in order to perform tasks such as setting default values.
We saw one of the important building blocks of OOP development: inheritance. The key to remember about inheritance is that it gives you the ability to clean up your codebase and create inherited classes that share common behavior. We reviewed the differences between private and public methods in Ruby classes. We analyzed how to categorize...