Please help me translate C# code to Ruby
- by Valentin Vasilyev
Here is the code:
using System;
using System.Collections.Generic;
using System.Linq;
namespace cs2 {
class Program {
static void Main(string[] args) {
var i=Fibs.TakeWhile(x=>x < 1000).Where(x=>x % 2==0).Sum();
}
static IEnumerable<long> Fibs() {
long a = 0, b = 1;
while (true) {
yield return b;
b += a;
a = b - a;
}
}
}
}