From: Sidney Burks Date: 2006-06-15T20:05:03+09:00 Subject: Re: Does each over an array bring a counter/index with it? ------=_Part_7918_2391904.1150369499327 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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_7918_2391904.1150369499327--