From: Gary Wright Date: 2008-02-17T01:25:21+09:00 Subject: Re: object specific methods and id On Feb 16, 2008, at 10:50 AM, UpsNDowns wrote: > * instance.class is a method like any other so it can be overriden > by the singleton, I think, so it can return whatever it wants. > Indeed if I from the singleton class does ObjectSpace.each_object > (self) {|x| puts x} only my instance is printed. (I suspect > ObjectSpace gets help from the VM/runtime). It can replace Object#klass, but it doesn't. Your ObjectSpace example is a good illustration of the singleton class/singleton object relationship models a class/instance relationship without actually being a class/instance relationship. > * Im not sure I understand what you mean by outside the hierachy. > My understanding is that the singleton is subclasses the original > class. class A; end class B < A; end a = A.new b = B.new S = (class <