Exercise 41. Learning to Speak Object Oriented

In this exercise I’m going to teach you how to speak “object oriented.” What I’ll do is give you a small set of words with definitions you need to know. Then I’ll give you a set of sentences with holes in them that you’ll have to understand. Finally, I’m going to give you a large set of exercises that you have to complete to make these sentences solid in your vocabulary.

Word Drills

class Tell Ruby to make a new type of thing.

object Two meanings: the most basic type of thing, and any instance of some thing.

instance What you get when you tell Ruby to create a class.

def How you define a function inside a class.

@ Inside the functions in a class, self is a variable for the instance/object being ...

Get Learn Ruby the Hard Way: A Simple and Idiomatic Introduction to the Imaginative World of Computational Thinking with Code, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.