From: "David A. Black" Date: 2008-06-18T20:47:26+09:00 Subject: Re: quick question about how array objects are handled Hi -- On Wed, 18 Jun 2008, Robert Klemme wrote: > On 18 Jun., 08:35, "David A. Black" wrote: >> On Wed, 18 Jun 2008, Chance Dinkins wrote: >>> Thanks guys, I apperciate it - these.. dynamic methods (is that what >>> they are considered?) are a little strange to me. >> >> The methods that expect a code block as part of the method call are >> iterators. Basically the code block is a piece of executable code that >> you're making available to be called from the method itself. >> Typically, that means that a method will fire the code block once for >> each element in a collection object like an array. > > Yes, but not in all cases. The presence of the block does not tell > you anything about the frequency of invocation. Just think about > File.open for example. So I'd say the general statement "The methods > that expect a code block as part of the method call are iterators" is > misleading. I said "typically" :-) One lesson at a time.... David -- Rails training from David A. Black and Ruby Power and Light: ADVANCING WITH RAILS June 16-19 Berlin ADVANCING WITH RAILS July 21-24 Edison, NJ See http://www.rubypal.com for details and updates!