Skip to content

Instantly share code, notes, and snippets.

@marocchino
Created October 22, 2011 16:50
Show Gist options
  • Save marocchino/1306200 to your computer and use it in GitHub Desktop.
Save marocchino/1306200 to your computer and use it in GitHub Desktop.
#ruby-1.9.2-p290
e = [*1..9].each # => #<Enumerator: [1, 2, 3, 4, 5, 6, 7, 8, 9]:each>
e.next # => 1
e.next # => 2
e.rewind # => #<Enumerator: [1, 2, 3, 4, 5, 6, 7, 8, 9]:each>
e.next # => 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment