Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Build an Address Book in Ruby Course (How To)

via Treehouse

Overview

In this course, you'll build a simple command line address book application using Ruby. You'll put to use a lot of skills learned in previous courses to put everything together: objects, classes, blocks, input and output, and more.

What you'll learn

  • Object Oriented Programming
  • Loops
  • Classes

Syllabus

Class Design

In this stage we're going to start to design the classes that we'll use throughout the rest of the address book program.

Chevron 11 steps
  • Contact Class: Part 1

    6:05

  • Create a Contact Class

    1 objective

  • Contact Class: Part 2

    4:04

  • Write a Method

    1 objective

  • Phone Number Class

    6:15

  • Write a to_s Method

    1 objective

  • Address Class: Part 1

    5:00

  • Address Class: Part 2

    3:44

  • Initializing and Calling Methods

    2 objectives

  • Address Book Class

    4:25

  • Instance variable instantiation

    2 objectives

Search

Search is an integral part of any address book application. In this stage, you'll learn how to add the ability to search to your classes.

Chevron 6 steps
  • Searching By Name

    5:46

  • Appending Contacts

    2 objectives

  • Searching by Phone Number

    6:29

  • Searching by Phone Number

    1 objective

  • Searching By Address

    3:35

  • Searching By Address

    1 objective

Input and Output

Our program functionality is all set up but our users have no way to interact with the program. In this stage we add a UI to the application and add a text based menu and interaction system.

Chevron 8 steps
  • Displaying a Menu

    3:57

  • Instance Variable Access

    1 objective

  • Adding Contacts: Part 1

    4:41

  • Adding Contacts: Part 2

    4:45

  • Searching the Address Book

    2:50

  • Searching the Address Book

    2 objectives

  • Saving The Address Book

    8:14

  • Review

    4 questions

  • Extra Credit

    Our program is in good shape but is lacking in some functionality. For extra credit, try adding the ability to delete contacts from the address book. You can also modify the address book program to use the methods we created for interacting with the address and phone numbers in the contact class.

Reviews

Start your review of Build an Address Book in Ruby Course (How To)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.