In this, you'll create an app that keeps track of dogs and their owners.
- Make an
environment.rb
file - Make
Dog.rb
,Owner.rb
, andDogOwner.rb
class files - Require all of your dependencies, including
pry
- Verify that running your environment file works
- Create a
Dog
class - Add a constructor that accepts a name and an age
- Add readers for name and age
- Create 2
Dog
instances in your environment - Verify that your dogs are in your environment when you run your app
- Create an
Owner
class - Add a constructor that accepts a name
- Add a reader for name
- Create 2
Owner
instances in your environment - Verify that your owners are in your environment when you run your app
- Create a
DogOwner
class - Add a constructor that accepts a dog and an owner
- Add readers for dog and owner
- Keep track of all
DogOwner
instances that have been created - Allow all of the
DogOwner
instances to be read - Create 3
DogOwner
instances in your environment - Verify that your dog owners are in your environment when you run your app
- Create a method for adding a dog to an owner
- Create a method for getting all of an owner's dogs
- Verify that you can get all of an owner's dogs when you run your app
- Create a method for adding an owner to a dog
- Create a method for getting all of an dog's owners
- Verify that you can get all of an dog's owners when you run your app
- Create a method for calculating the average age of an owner's dog's
- Verify that you can get all of an owners' dogs' ages when you run your app
Once you've done all of this, delete your files and do it again. Repeat until you can do all of the steps without thinking about them.