From: Joel VanderWerf Date: 2004-05-29T07:18:13+09:00 Subject: Re: Calling global method Sean O'Dell wrote: > On Friday 28 May 2004 13:41, Austin Ziegler wrote: > >>>On Friday 28 May 2004 13:02, Austin Ziegler wrote: >>> >>>Well, I find it useful as I'm a bit stuck right now about how to >>>call a global method without producing some ugly code. It looks >>>like ugly is going to win, though, since there is no clean >>>built-in way to do it. >> >>1. What built-in method? Perhaps you've chosen the wrong method. >>2. If it's not built in, why aren't you boxing it yourself? > > > The timeout method, module "timeout." Is alias too ugly? require 'timeout' alias global_timeout timeout module M def M::foo n global_timeout(n) {sleep} end def M::timeout n puts "M's timeout" end end M.foo 3