Skip to content

Instantly share code, notes, and snippets.

@embasbm
Created September 5, 2015 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save embasbm/3424693ce4ae5d38d8bd to your computer and use it in GitHub Desktop.
Save embasbm/3424693ce4ae5d38d8bd to your computer and use it in GitHub Desktop.
natural_numbers = Enumerator.new do |yielder|
number = 1
loop do
yielder.yield number
number += 1
end
end
@embasbm
Copy link
Author

embasbm commented Sep 5, 2015

I don't quiet understand what does ( yielder.yield number ) do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment