Rubyでフィボナッチ数列を求める 〜Rubyでオイラープロジェクトを解こう!Problem2

Problem 2 - Project Eulerより

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
Find the sum of all the even-valued terms in the sequence which do not exceed four million.
フィボナッチ数列の項は前の2つの項の和である。 最初の2項を 1, 2 とすれば、最初の10項は以下の通りである。
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
数列の項が400万を超えない範囲で、偶数の項の総和を求めよ。

先日解いた問題はここの問題だった

def fibo_even_sum(max, a=1, b=2)
  sum = 0
  loop do
    break if a >= max
    sum += a if a.even?
    a, b = b, a + b
  end
  sum
end
fibo_even_sum 400_0000 # => 4613732