The term metaprogramming can be translated into self-referential programming, which describes programming that can read, generate, analyze, and transform itself or another programming. Within Ruby, the concept and its application are often described as the language’s ability to dynamically define and redefine methods and classes at runtime, but it is not limited to this implementation. This ability to define methods and transform the program at runtime allows us to write dynamic code that avoids repetition and is often reusable. Metaprogramming is used within Ruby at every turn, and understanding the core concept of how Ruby uses it to create cleaner…

Adam Thorne

Full-Stack Web Developer studying @ Lighthouse Labs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store