From: Joel VanderWerf Date: 2004-02-25T07:50:04+09:00 Subject: Re: instance_eval and constants Aron Griffis wrote: > Hello, > > I think this used to work in the past, but isn't working with recent > Ruby versions (since sometime in the 1.6.x stream): > > class MyClass > SomeConstant = 1 > def MyClass.block(&block) > instance_eval(&block) > end > end > > MyClass.block { puts SomeConstant } MyClass.block { puts self::SomeConstant } That overrides the static scoping, at least in the current 1.9.0. But I don't know what's going to happen in the future.