Rational Numbers for trees i ruby