From: Yukihiro Matsumoto Date: 2012-02-21T02:29:04+09:00 Subject: [ruby-core:42769] [ruby-trunk - Bug #6053] Enumerator#rewind goes to beginning instead of decrementing one step. Issue #6053 has been updated by Yukihiro Matsumoto. It is a bug in documentation. #rewind method rewinds the sequence to the beginning. ---------------------------------------- Bug #6053: Enumerator#rewind goes to beginning instead of decrementing one step. https://bugs.ruby-lang.org/issues/6053 Author: Chris Maddox Status: Open Priority: Normal Assignee: Category: Target version: 1.9.3 ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0] From the ruby docs: rewind ��� e Rewinds the enumeration sequence by one step. In practice, however, it fully rewinds (either change documentation or have it do what it says. Going back one step is nice though): irb(main):001:0> a = [1,2,3,4] => [1, 2, 3, 4] irb(main):002:0> b = a.to_enum => # irb(main):007:0> b.next => 1 irb(main):008:0> b.next => 2 irb(main):009:0> b.next => 3 irb(main):010:0> b.rewind => # irb(main):011:0> b.next => 1 -- http://bugs.ruby-lang.org/