From: "Mauricio Fernández" Date: 2004-08-11T08:26:20+09:00 Subject: Re: Singleton class methods On Wed, Aug 11, 2004 at 07:51:43AM +0900, Kyle Putnam wrote: > Your example clears most of this up, for me anyway. However, is there a > way to access this other scope? Obviously Test::A accesses the > non-singleton(?) class's constant. Is this other scope even accessable > from outside the singleton class? > > irb(main):001:0> class << self > irb(main):002:1> CONSTANT = 50 > irb(main):003:1> end > => 50 > irb(main):005:0> self.class::CONSTANT > NameError: uninitialized constant CONSTANT > from (irb):5 try >> class << self; FOO = 1; end => 1 >> class << self; self end::FOO => 1 -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com