eval = new_expression.join
This calls new_expression.join
and stores the result in a local variable called eval
. Since you never use that local variable, you could as well just have written:
new_expression.join
If it was your intention to call Ruby's eval
method with the result of new_expression.join
as its argument, you should remove the assignment operator:
eval new_expression.join
That said using eval
to evaluate the expression is only a good idea if you're only ever evaluating trusted input.