Practice building classes and learn how classes can interact with each other.
You will be building an Owner
, Fish
, Dog
, and Cat
class. Owner will know
about all its pets, be able to buy a pet, set the name of a pet (which the pet
can't change, because that would be weird), change a pet's mood through walking,
feeding, or playing with it, and list all of its pets.
Write your code in the cooresponding files in the lib
directory. Run the tests
and build out your classes. Let the tests guide how to build your classes.
Sandi Metz's Practical Object-Oriented Design in Ruby: An Agile Primer - Chapters 1 and 2, page 26
KWK-L1 Objective