Cast result java values to ruby type.