GithubHelp home page GithubHelp logo

oo-relations-lecture-web-012918's Introduction

Twitter

Overview

Where we've been

school = School.new('Flatiron School') school.students => ["Isaac", "Caroline", "Zahran"]

student = Student.new('Isaac') student.school -> "Flatiron School"

Where we'll be from here on out

school = School.new('Flatiron School') school.students => [<Student @name="Isaac">, , ]

student = Student.new('Isaac', School.new('Flatiron School')) student = Student.new(String.new('Isaac'), School.new('Flatiron School')) student.school

Objectives

  • Object relationships, has many/belongs to
  • Single source of truth

Deliverables

  1. Create a User class. A user should initialize with a username and have a reader and writer method for the username. A user should have a method called #tweets that returns an array of Tweet instances.
  2. Create a Tweet class. A tweet should have a method called #message that points to a string and #user that points to an instance of the user class. It should have a method called .all that returns all the Tweets created.
  3. Tweet instances should respond to a message called #username that returns the username of the tweet's user.
  4. User instances should respond to a method called #post_tweet that takes in a message, creates a new tweet and adds it to that user's collection.

oo-relations-lecture-web-012918's People

Contributors

alexgriff avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

harenarium jaf7

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.