Skip to content

Instantly share code, notes, and snippets.

@nathankleyn
Created December 30, 2012 12:09
Show Gist options
  • Save nathankleyn/4412546 to your computer and use it in GitHub Desktop.
Save nathankleyn/4412546 to your computer and use it in GitHub Desktop.
Gist #5 For "Functional Programming Techniques With Ruby: Part III"
x = [1, 2, 3]
enum = x.each
puts enum.class # => Enumerator
puts enum.next # => 1
puts enum.next # => 2
puts enum.next # => 3
puts enum.next # => StopIteration exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment