formula parser in Rails with eval() ?

Hey guys!

I'm relative new to Ruby on Rails, so I'm not sure how to solve following problem:

Their are different 'families', which have different values for attributes like 'lc1' or 'ram1' or so on... e.g. ( lc1 = [3,7, 8, 9,15] ...) My formula could look like this "3.0+lc1/log(ram1)". I calculated the log also before and saved the results also in an array, because I thought it could be used with the eval method.

The problem is I'm not sure how to use it, because there could be also 7 attributes and 5 logs e.g. I don't know how to make it dynamic according this needs.

For this example, i would use: lc1 = lc1[i]; log(ram1) = log(ram1)[i]; eval("3.0+lc1/log(ram1)")

I hope anybody can help me, because i couldn't find much examples on this method.

Thanks to any comment or suggestion! Regards Sabine