From: Joey Date: 2006-06-15T20:15:27+09:00 Subject: Re: Does each over an array bring a counter/index with it? ------=_Part_6784_5912747.1150370123899 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline It is there by default. j`ey http://www.eachmapinject.com On 6/15/06, Sidney Burks wrote: > > Do you have to do > > 'require enumerable' > > each time you want to use it, or should it be accessible by default? > > > Thanks, > -Sidney > > On 6/15/06, Dave Burt wrote: > > > > Duane Morin wrote: > > > If I'm "each"ing over an array, is there a built-in way to get the > > > numeric index of the item that I'm on, or do I have to increment my > own > > > counter variable? I saw each_with_index but that seems to be for > Hash, > > > not Array. > > > > It's for Enumerable, which is mixed-in to Array and Hash, so you will be > > able to use it. > > > > Cheers, > > Dave > > > > > > ------=_Part_6784_5912747.1150370123899--