Posts By: Arild Shirazi

Ruby Meta - Method Madness

Ruby metaprogramming is fun and very rewarding, but also a little bewildering. One of the great things about Ruby is that you can dynamically add methods to objects. Ruby gives us #eval, #instance_eval, and #class_eval for this purpose, but the names aren’t as clear as one might expect, and can lead to some confusion. Hopefully the code examples below help clarify how each is used, and get on on the way to meta-mastery.

Read More