From: Trans Date: 2006-10-02T21:10:08+09:00 Subject: Re: Why can't I get on Top? Jeffrey Schwab wrote: > module Test > def self.included( base ) > p base == $toplevel > end > end > > class << self > > # $toplevel has to be set in here, > # where it can really refer to the > # including object. > > $toplevel = self > include Test > end In your example you are controlling the inclusion from the start. That's missing the point. The #included callback catches the inclusion of a module and _reacts_ to that. The module is a resuable lib that an end-user/programmer may well include at the toplevel and the module should just work. Otherwise one has to document: "IMPORTANT: don't include at toplevel, It won't work...." But you also may not realize that methods defined at the toplevel do not go to the singleton. They go to Object itself. So really your example should be: class Object $toplevel = self include Test end But you are getting a false positive, since: module NotTheTopLevel $toplevel = self include Test end works too. T.