From: Mark Date: 2004-02-15T01:02:05+09:00 Subject: Re: accessing constants from class methods 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 Best Regards Mark Sparshatt