Self learned the answer:
Here's the code sample, how you can do it.
static void Job22(Args _args)
{
str expr = 'ab==2';
str method = @'boolean eval(int ab){return ' + expr + ';}';
boolean result;
;
result = runBuf(method, 5);
info (strfmt("Calculation result is %1", result));
}