Basic question: how to use Enumerable#each_slice

This are examples from library documentation
(1..10).each_slice(3) {|a| p a}
(1..10).each_cons(3) {|a| p a}

but when I run them in fxri, got such errors:

undefined method `each_slice' for 1..10:Range

Do I need to require any module?

···

--
Posted via http://www.ruby-forum.com/.

Yes, enumerator.

  robert

···

On 13.10.2007 11:25, Liang He wrote:

This are examples from library documentation
(1..10).each_slice(3) {|a| p a}
(1..10).each_cons(3) {|a| p a}

but when I run them in fxri, got such errors:

undefined method `each_slice' for 1..10:Range

Do I need to require any module?