I was reading through the documentation for Enumerator
and I ran across this example:
fib = Enumerator.new do |y|
a = b = 1
loop do
y << a
a, b = b, a + b
end
end
Everything makes sense to me except for this line: a, b = b, a + b
. Could somebody please explain what's happening?