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 ...

Get Ruby Wizardry 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.