In this chapter, we cover several techniques you can use to make high-quality classes.
Initialize Method
When instantiating a class in Ruby, the new class method calls the initialize instance method. Any parameters passed to the new method will be passed to the initialize method. The initialize method is a setup method for a class. It’s called before any other method defined in the class. If we have steps to perform before using the class, we place them in the initialize method. Let’s look at techniques we can use to improve our initialize methods.