DriversManual: Metaprogramming Ruby Chapter 1

Ch 1: The M Word

Ghost Towns and Marketplaces

Bob’s First Attempt

class Movie < ActiveRecord::Base


Quiz Questions

Q: How is Metaprogramming defined in this chapter?
A: Metaprogramming is code that writes code
Q: What is introspection?
A: The ability for code to "know" about itself
Q: What is the more formal definition of Metaprogramming given later?
A: Metaprogramming is writing code that manipulates language constructs at runtime.
Q: What's the difference between *static* and *dynamic* Metaprogramming?
A: Both involve code that writes code, but Dynamic code writes to its own language while static metaprogramming writes to another language.