From: Pit Capitain Date: 2007-08-23T04:58:31+09:00 Subject: Re: Can the self object be changed inside a Proc? 2007/8/22, Emmanuel Oga : > Hello, basically i want to change the self object inside a proc so i can > do a thing like this: > > the_proc= lambda { @variable } > > class Test1 > def initialize proc > @variable= 1 > # Here i need to bind somehow the proc to the instance of Test1 > puts proc.call # should emit 1 from @variable > end > end > > (...) Emmanuel, just change proc.call to instance_eval(&proc) Regards, Pit