On Oct 5, 2005, at 10:36 AM, Dave Burt wrote:

> The coolest bit, though, is passing the  parameter (local) variable  
> action to instance_eval inside the define_method  block. I don't  
> quite get how that works; if you read my code, you'll see I
> defined that function into a separate method. I thought methods  
> were banned from accessing local variables from outside their scope  
> - this one seems to be staying in like in a closure.

define_method() builds a method from the provided block and all Ruby  
blocks are closures.  That's why it behaves differently, I think.

James Edward Gray II