From: Marcelo Alvim Date: 2006-08-07T06:00:14+09:00 Subject: Re: Iterating over an array n element at a time > Just a tiny little trap you fell into, look at this > [1,2,3].each_slice(2){|s| p s} > NoMethodError: undefined method `each_slice' for [1, 2, 3]:Array > from (irb):1 > > but > > irb(main):003:0> require 'enumerator' > => true > irb(main):004:0> [1,2,3].each_slice(2){|s| p s} > [1, 2] > [3] > > I have fallen into that one more than once and I still will, it is a little > bit unclear why Enumerable is not in the core while it is in the core doc. > But well just a minor hickup. Oh, I see! Thanks for the pointer. I thought Array mixed that in, so it should be defined for it. But then again, I'm still getting used to modules, mixins and such. Been too long in a Java-only world... Thanks again, Marcelo Alvim.