Chapter 2Monday: The Object Model

Glance at any Ruby program, and you’ll see objects everywhere. Do a double take, and you’ll see that objects are citizens of a larger world that also includes other language constructs, such as classes, modules, and instance variables. Metaprogramming manipulates these language constructs, so you need to know a few things about them right off the bat.

You are about to dig into the first concept: all these constructs live together in a system called the object model. The object model is where you’ll find answers to questions such as “Which class does this method come from?” and “What happens when I include this module?” Delving into the object model, at the very heart of Ruby, you’ll learn some powerful techniques, ...

Get Metaprogramming Ruby 2 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.