Ruby Build an Address Book in Ruby Class Design Address Class: Part 2

Benjamin Raskin
Benjamin Raskin
4,075 Points

How does the program know to use the 'address' to_s method and not the to_s method from the 'contact' file?

When calling the to_s method within the print_addresses method.

1 Answer

Maciej Czuchnowski
Maciej Czuchnowski
36,423 Points

If this method is called on an instance of the Address class, then it will look for this method in the Address class.