prog.rb

Dave Thomas, 11/01/2011 01:24 AM

Download (129 Bytes)

 
1
words = Fiber.new do
2
  %w{ cat dog }.each { |line| Fiber.yield line }
3
end
4

    
5
puts words.resume
6
puts words.resume
7
puts words.resume