Friday, 22 October 2010

Metaprogramming Ruby

I explained here (in greek) a bit about metaprogramming and here about an application in a python/c++ finite element code but this book is everything you need about metaprogramming in Ruby. Written by Paolo Perrotta in a way that two colleagues discuss and solve every day problems. The book is full of example code and assumes some basic knowledge of the Ruby language. The first part of the book deals with general metaprogramming concepts in Ruby from objects and methods to blocks and classes to finally code that writes code. The second part dives in the metaprogramming techniques of Rails, with ActiveRecods being the most important part. The last chapter deals how to use metaprogramming safely. As Yukihiro "matz" Matsumoto says in the foreword "It's a bit like magic", but be ware because there is white magic and black magic.

No comments:

Post a Comment