From: Bertram Scharpf Date: 2005-04-16T11:10:59+09:00 Subject: Re: Why specify module names redundantly in Modules? Hi, Am Samstag, 16. Apr 2005, 04:34:36 +0900 schrieb Chris: > But I have a question about Modules... Why when I declare a Module, do > I have to prefix all the routines in that module with the module name > (or routines outside the module don't see it)? I don't get that? > Isn't this kind of redundant? For instance, I can't do this: > > Module Foo > def bar > "bar" > end > end > > puts Foo.bar > > I have to do this: > > Module Foo > def Foo.bar > "bar" > end > end > > What's up with that? Seems redundant to me. (Oh, I already said > that!) :-) But I thought I would ask. Maybe there is a good reason > for this? Or, maybe there is a way around this? Say what you mean, understand what you say. `bar' is a modules instance method. `Foo.bar' is a modules classes singleton instance method, shortly a class method. Please continue asking if you don't see it. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de