Basically, you just need to check your inputs and make sure they would create valid ruby code. If so, you can use the string eval. If not, you can use the block eval.