From: "David A. Black" Date: 2004-02-15T03:53:06+09:00 Subject: Re: accessing constants from class methods Hi -- On Sun, 15 Feb 2004, Mark wrote: > David A. Black wrote: > > >OK, it's probably something simple but I'm staring and staring at the > >original code, and its output (which is the same as daz's code), and I > >can't figure out why it wasn't OK. > > > >Explanations welcome :-) > > > > > > > > The origional code defines x as > > def x > # defined?(self::X) ? self::X : nil > end > > while daz's code says > > def x > const_defined?(:X) ? const_get(:X) : nil > end > > it uses const_defined and const_get Yes, that much I saw :-) What I didn't get was what the problem was to begin with. self::X looked to me like it worked fine. David -- David A. Black dblack@wobblini.net