O'Reilly logo

Ruby Wizardry by Eric Weinstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Everything Is an Object (Almost)

The Subject of Our Story Is an Object

Scarlet ran to the Computing Contraption. “Do you know the name of that directory of everyone in the kingdom?” she called to the King. “It’s a hash that associates everyone’s name with his or her address.”

“Let’s see,” said the King. “Ah, yes! I’m pretty sure it’s called citizens.”

Scarlet nodded and began typing into IRB. When she pressed ENTER, this is what she saw:

>> citizens
=> {
  :aaron_a_aardvark => 'A van down by the river',
  :alice_b_abracadabra => 'The green house with two chimneys',
  :trady_blix => 'Mal Abochny',
  # ...and so on and so forth

The King peered over her shoulder. “That’s it!” he said. “But whoa! There must be a bajillion people in the kingdom! How ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required