From: Eric Schwartz Date: 2002-11-09T03:33:40+09:00 Subject: Re: understanding modules/classes Austin Ziegler writes: > It does matter where you put it, to a degree. "include" simply > includes the methods and classes from a module into the current > object scope. The "standard" object scope is (more or less) the > Object object. > > Thus, when I do: > > include MIME::Types > > Then I have made it so that I can call the MIME::Types functions > without any specifiers (although it may not be a good idea to do > so). Okay, I'm still confused. I get the feeling that I just walked right past the point without even noticing it. You seem to be talking about Modules as if they're just collections of functions. I see them as a way of implementing namespaces for Ruby objects, which I see as necessary. Otherwise, as I understand it, if I defined a TestTableModel class, and you do too, you will silently extend mine, instead of creating an entirely new class (or better yet, warning you of the problem and falling over and dying). Whereas if I hide them inside a TestHarness Module, you'd have to explicitly "include" it to get that problem, and at least at that point you can be presumed to know what you're doing. -=Eric -- Come to think of it, there are already a million monkeys on a million typewriters, and Usenet is NOTHING like Shakespeare. -- Blair Houghton