Created
February 27, 2013 20:08
-
-
Save jakeonrails/5051233 to your computer and use it in GitHub Desktop.
PING PONG ENUMERATOR!
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
pinger = Enumerator.new do |yielder| | |
loop | |
yielder << "PING" | |
end | |
end | |
pinger.each do |ping| | |
puts ping | |
puts "PONG" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment