Jun 05, 2007 @ 07:16 am

In the first part, I tried to cover the basics of code blocks. Now, we’re going to talk about : Code blocks and scope
A code block is a closure
Oh no… not another definition of a closure? Yes, but I promise I will be quick. First, to understand what a closure is we have to […]

Posted under : In depth
May 27, 2007 @ 10:28 pm

A while back, I wrote an introduction on code blocks. So if you’re not sure what they are, you should read it first.
Something I find interesting with code blocks is that they create the illusion of being executed at the moment they are written. It’s easy to get fooled, because when you look at […]

Posted under : In depth
May 21, 2007 @ 05:30 am

Understanding the “chain”
In my last article, I explained where the various elements of an object were located. Now it’s time to understand what happens at run time when you write the following :

obj.my_instance_method

Ahh… A method call! Ruby knows what to do in this situation. Remember that inside “obj” resides a reference to MyClass? Well, ruby […]

Posted under : In depth