From: Sean O'Dell Date: 2004-05-29T06:15:22+09:00 Subject: Re: Calling global method On Friday 28 May 2004 13:57, Bill Kelly wrote: > > From: "Sean O'Dell" > > > On Thursday 27 May 2004 22:52, Bill Kelly wrote: > > > Not super pretty, but I'm currently using: > > > > > > def somemodule::somemethod > > > Kernel.instance_eval { test() } > > > end > > > > That's pretty ugly. I figured it would come down to having to do > > something icky like this. Bah. > > How 'bout: > > class Global > def self.method_missing(meth_id, *args) > Object.instance_eval { self.send(meth_id, *args) } > end > end > > Then we can do: > > def somemodule::somemethod > Global.test # or Global::test > end I think it should be something built-into the language, so while this is much nicer, it's still not something I'm happy with. Sean O'Dell