but you could make the date class do all the calculation work for you

The date class takes care of all the leap year calculations

If you have two date objects (now and born)

this would calculate the year difference

y_dif = now.year - born.year

if Date.new(now.year - year, now.month, now.day) < born

y_dif = y_dif - 1

end

It calculates the difference between the years, checks if subtracting does create a dat prior to the born date

All your leap year calculus is taken into account by the date substraction

I will work on the other two later today

months and days can be calculated in a similar fashion (be it a little bit more complex)