Git Product home page Git Product logo

ruby-oo-object-relationships-my-pets-london-web-120919's Introduction

My Pets

Objective

  1. Gain a deeper understanding of object relations.
  2. Build classes that produce objects that interact with one another through associations and behavior.

Instructions

This is a test-driven lab. Use the test file and test output to understand what is being asked of you as you follow the guidelines below.

Overview

You will be building an Owner, Dog, and Cat class. An Owner will know about all their pets, be able to buy a pet, change a pet's mood through walking or feeding it, and sell all of their pets (for when they move to that tiny NYC studio after college).

A Dog and a Cat are initialized with a name and an Owner object

Part I: Object Models

  • Define a Dog and Cat class that have the attributes required by the test suite. Keep in mind, some of the attributes should be readable and writable (i.e. attr_accessors), while others may need to be just setters (attr_writer) or just getters (attr_reader). The test suite will make this clear so pay attention to the test output.

Part II: Object Relations

  • An owner should be able to buy and sell a pet, which will change the pet's mood.

  • When an owner buys a new pet, the buy_cat/buy_dog methods take in an argument of a name. You must take that name and do the following:

    • Make a new instance of the appropriate pet, initializing it with that name and the owner who is purchasing it.
  • An owner should have the ability to walk all their dogs or feed all their cats, which will change the mood of all of their pets of that type to "happy".

Owner, Dogs and Cats

These are just a few hints and guidelines to help you through this lab. This lab is extensive and challenging. Rely on the guides here, refer to the previous Code Along on object relations, and read the test output and test files. Never forget to ask a question on Learn if you are stuck. And remember, as a programmer, your job is to fix broken code! Broken code is the norm, the baseline, the starting point for all of the projects you will build. Embrace it!

View OO My Pets on Learn.co and start learning to code for free.

ruby-oo-object-relationships-my-pets-london-web-120919's People

Contributors

kthffmn avatar ahimmelstoss avatar maxwellbenton avatar sophiedebenedetto avatar annjohn avatar arelenglish avatar bamsarker avatar fislabstest avatar drakeltheryuujin avatar jmburges avatar curiositypaths avatar fs-lms-test-bot avatar donnadieu avatar imkaruna avatar paulnicholsen27 avatar sarogers avatar victhevenot avatar

Watchers

 avatar  avatar  avatar Bernard Mordan avatar Otha avatar raza jafri avatar  avatar Joe Cardarelli avatar  avatar  avatar  avatar  avatar Matt avatar Antoin avatar  avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Ahmed avatar Nicole Kroese  avatar Kaeland Chatman avatar Lisa Jiang avatar Vicki Aubin avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.