From: Tobias Reif Date: 2001-10-28T07:13:32+09:00 Subject: [ruby-talk:23650] Re: sleeping, calling methods inside class defs Avi Bryant wrote: > puts self #=> main > puts self.class #=> Object > > So it appears that the toplevel is implicitly in the context of an > instance of Object, except that it also lets you define methods in Object. > Which is simpler, if less consistent. That's what confuses me. Oversimplified: Generally, I'm either inside inside a class def, where there's no onject context. Or I'm outside a class def, and call instance methods of an instance. No with stuff like my snippet: I can define methods -> It looks as if I'm inside a class def for class Object. I can call instance methods ("without an instance" -> I'm always getting an instance of class bject when I call a method.) -> like I'm outside a class def and inside an object instance context. What's the underlying concept here? Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/