fibs = Enumerator.new do |yielder|
  a, b = 0, 1
  loop do
    yielder << a
    a, b = b, a + b
  end
end

puts fibs.take(10).inspect

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: