Day 2: Floating Down from the Sky

At the time, one of the most striking scenes in Mary Poppins was her entrance. She floated into town on her umbrella. My kids will never understand why that entrance was groundbreaking stuff. Today, you’re going to experience a little bit of the magic that makes Ruby click. You’ll learn to use the basic building blocks of objects, collections, and classes. You’ll also learn the basics of the code block. Open up your mind to a little magic.

Defining Functions

Unlike Java and C#, you don’t have to build a whole class to define a function. You can define a function right in the console:

>>​ def tell_the_truth
>>​ true
>>​ end

Every function returns something. If you do not specify an explicit return, the ...

Get Seven Languages in Seven Weeks 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.