Giter Site home page Giter Site logo

oo-ruby-practice-web-040317's Introduction

Object Oriented Practice

Create three related ruby class models only using Ruby. No ActiveRecord or SQL You can either use your own (get approval from an instructor) or use one of the ideas below.

For examples we'll be using the Song, Artist and Genre models.

Ideas to use:

  • Doctor, Patient, Appointment
  • Character, Show, Actor
  • City, Country, Landmark
  • Teacher, Student, Cohort (don't use Class because it's reserved in Ruby)

Steps to follow

  1. Each class should keep track of all instances created by it
  2. Each instance of a class should be able to reference instances associated by the other two classes
  • The instance can either keep track of multiple associated instances or one
  • Ex. an instance of Artist can have many Song instances, but an instance of Song might only have one Artist associated * artist.songs, song.artist
  1. One class should be responsible for creating an instance of another class and associating each instance
  • Ex. In the real word an Artist should be responsible for creating a song so there should be a method in the Artist class for our artist Jay-Z to create his new track Lucifer
  • Something like jayz.create_song("Lucifer")
  • Now calling jayz.songs should return an array of song instances including the Lucifer song instance

oo-ruby-practice-web-040317's People

Contributors

jjseymour avatar

Watchers

James Cloos 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.