Damin M. Gonzlez wrote in post #1076182:
> Yeee, I can see that they are not the same object, made this test:
>
> irb(main):022:0> class << Foo
> irb(main):023:1> self.object_id
> irb(main):024:1> end
> => 10361628
> irb(main):025:0> class Foo
> irb(main):026:1> self.object_id
> irb(main):027:1> end
> => 10361640
>
>  But why?
>

Because ruby has two distinct entities: a class and what's known as a "singleton class".  When you write:

@some_var = 10

...that instance variable gets attached to whatever self is.  And inside a singleton class, which is opened by writing:

class << Foo


end


self is the "singleton class".    Inside a regular class (but outside any method definitions), self is the class.