You can use eval:
code="@var.reverse"
@var="Hello"
@result = eval(code) # => "olleH"
But be very careful in doing so; you’re giving that code full access to your system. Try out eval('exit()') and see what happens.
You can use eval:
code="@var.reverse"
@var="Hello"
@result = eval(code) # => "olleH"
But be very careful in doing so; you’re giving that code full access to your system. Try out eval('exit()') and see what happens.