From: Robert Klemme Date: 2011-07-30T22:38:09+09:00 Subject: Re: avoiding capturing local variables in closures On Sat, Jul 30, 2011 at 10:14 AM, Robert Dober wrote: > > > Answered by Michael > >> Further, what if I have an instance var that is referencing some large data? Do I need to worry >about that being captured by the block or does it not matter because the block has already >captured self? > > At first sight you need to worry if you pass the block to a method > outside of the receiver because that will create a new reference to > "self". > As long as you pass the block around in the same object I do not see an issue. Generally care should be taken about the value of self when a long lived block is created. Typically classes are better candidates than instances. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/