>> def test
>> eval("x = 2", binding)
>> p local_variables
>> p x
>> end
=> nil
>> test
["x"]
NameError: undefined local variable or method `x' for main:Object
from (irb):4:in `test'
from (irb):6
|
Pastie
Support Pastie
or read my
Pastie << self
blog
>> def test
>> eval("x = 2", binding)
>> p local_variables
>> p x
>> end
=> nil
>> test
["x"]
NameError: undefined local variable or method `x' for main:Object
from (irb):4:in `test'
from (irb):6
|