I have been using Generator in 1.8, and now I need to port that code to
1.9. My code looks essentially like the code below. I’m confused as to
what the correct option is in 1.9: Fibers? Enumerator?
Enumerator::generator? I’d like to know the simplest most
straightforward option possible, since I’m still a relatively novice
Any help gratefully received!
Generator.new do |g|
(1…10).each do |number|
@foo = bar
if (number = @foo.next)