Created
September 5, 2015 12:17
-
-
Save embasbm/3424693ce4ae5d38d8bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
natural_numbers = Enumerator.new do |yielder| | |
number = 1 | |
loop do | |
yielder.yield number | |
number += 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't quiet understand what does ( yielder.yield number ) do