Robert Dober wrote:
> I could however not see the difference between A and Object, can you
> explain please?

The OP used an *instance* of class Object, not Object itself, and 
compared it with class A, which is an instance of class Class.

Perhaps it's clearer if written thus:

obj = Object.new
obj_meta = (class << obj;self;end)
def obj.foobar; end
p obj.singleton_methods            #=> ["foobar"]
p obj_meta.instance_methods(false) #=> ["foobar"]

a = Class.new
a_meta = (class << a;self;end)
def a.foobar; end
p a.singleton_methods            #=> ["foobar"]
p a_meta.instance_methods(false) #=> ["allocate", "superclass", 
"foobar", "new"]

-- 
Posted via http://www.ruby-forum.com/.