From: Jos Backus Date: 2004-12-03T01:51:42+09:00 Subject: Re: Accessing class constants from within a module? On Thu, Dec 02, 2004 at 08:08:11PM +0900, Michael C. Libby wrote: > > On Thu, 2004-12-02 at 16:21 +0900, Jos Backus wrote: > > > Joel's solution was what I was looking for originally (thanks > > Joel!) but your solution admittedly works well too. Thanks for > > that, Michael. > > I like the self.class::CONSTANT expression better myself because it > keeps the object instances cleaner. I just didn't think it would be > thateasy and went for the first thing that might work that came to mind. Your solution has the advantage that you can control debugging on a per-object basis. Depending on the state of the object, while debugging, this can sometimes be handy. > Next time I'm going to be thinking, "ok, I know Ruby has an > easier/faster/cleaner way to express this." :) My words exactly :) > -Michael Libby Cheers, -- Jos Backus _/ _/_/_/ Sunnyvale, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ jos at catnook.com _/_/ _/_/_/ require 'std/disclaimer'