I know writing like

```
a=23
p "the value of a is #{a}"

```

it will print: `the value of a is 23`.

but now I am actually receiving this string as a parameter like

```
def evaluate string
  a=23
  puts string
end

```

calling method pass that string as a parameter

```
evaluate "the value of a is #{a}"

```

Is there any way to evaluate this string inside the method? `puts string` has to interpolate the value a=23.

**Edit:**

I have to read and execute the program from Excel.

At the first line,

Excel entry is,

```
"id=something" setvalue a

```

So now corresponding program will read the value from locator id=something and set it into the instance variable @a.

and user's next excel entry would be

```
"the value of a is 23"  compare "the value of a is #{a}"

```

Now the program will read "the value of a is 23" and this "the value of a is #{a}" for comparison, but before it compares, it has to replace the value a. That's all I want. I hope now my question is very clear.