O'Reilly logo

Ruby Under a Microscope by Pat Shaughnessy

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

image with no caption

Metaprogramming becomes much easier to understand once you learn how Ruby implements it internally.

One of the most confusing and daunting subjects Ruby developers face is metaprogramming. Metaprogramming, as indicated by the prefix meta, literally means to program at a different or higher level of abstraction. Ruby provides many different ways for you to do this, allowing your program to inspect and change itself dynamically. In Ruby, your program can change itself!

Some of Ruby’s metaprogramming features allow your program to query for information about itself—for example, information about methods, instance variables, ...

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