Giter Site home page Giter Site logo

ruby-oo-relationships-practice-auto-shop-exercise's Introduction

LOOKIN' FOR ADVENTURE - HEAD OUT ON THE HIGHWAY

Word has just come from the higher-ups, and you're in charge of building out a domain that keeps track of cars, their owners, and the mechanics that service them. Each car has its own classification, like "antique", "exotic", or "clunker", and each mechanic has a specialization (these are the same as car classifications). You don't want to take your sweet souped up '94 Camaro to some jerk that specializes in beamers right?

Each CarOwner may have a ton of cars, but these folks are fanatical about their maintenance, and only see one mechanic per car.

The basics have been built out for you, but you'll need to figure out the relationships and create most of the methods. Hook it up!

Deliverables

Here's what we need to be able to do.

CarOwner

  • CarOwner.all Get a list of all owners

  • CarOwner#cars Get a list of all the cars that a specific owner has

  • CarOwner#mechanics Get a list of all the mechanics that a specific owner goes to

  • CarOwner.average_number_of_cars Get the average amount of cars owned for all owners

Car

  • Car.all Get a list of all cars

  • Car.classifications Get a list of all car classifications

  • Car.find_mechanics(classification) Get a list of mechanics that have an expertise that matches the passed in car classification

Mechanic

  • Mechanic.all Get a list of all mechanics

  • Mechanic#cars Get a list of all cars that a mechanic services

  • Mechanic#car_owners Get a list of all the car owners that go to a specific mechanic

  • Mechanic#car_owners_names Get a list of the names of all car owners who go to a specific mechanic

ruby-oo-relationships-practice-auto-shop-exercise's People

Contributors

realandrewcohn avatar thuyanduong-flatiron avatar notnotdrew avatar maxwellbenton 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.