Summary
In this chapter, you learned about metaprogramming and when to use it. You learned about the pros and cons of abstraction, and how to use metaprogramming to eliminate redundancy. You learned about the block-based and eval
-based approaches to metaprogramming, and when to use each. You also learned about the trade-offs involved in deciding whether to use method_missing
or define_method
.
In the next chapter, you'll use this metaprogramming knowledge to design useful domain-specific languages.