From: James Edward Gray II Date: 2006-05-09T05:37:36+09:00 Subject: Re: Question about instance_eval On May 8, 2006, at 3:30 PM, Pat Maddox wrote: > t.instance_eval { foo = 'foo' } Ruby will always see the above as a local variable declaration. There is no way around that. > I also know that t.instance_eval { @foo => 'foo' } would work in this > case. However, I'm trying to set a Rails attribute, so I have to go > through the method accessor. You've showed one way to handle it. Another is the use write_attribute(), if we are talking about ActiveRecord. James Edward Gray II