Having an empty
initalize method is not necessary, but if you want your object to take some data in when you create in then this is the way to do it.
So if you have:
@name = name
person = Person.new("ruby")
This creates a new person object, Ruby calls
initialize for you as part of the object creation process & it will pass to it any parameters that you pass to
The result is that you can then save these parameters as instance variable to use them later.
If you are coming from another OOP language you may be familiar with the concept of "constructors", that's exactly what