From: Robert Klemme Date: 2005-04-16T18:29:34+09:00 Subject: Re: Why specify module names redundantly in Modules? "Paul Battley" schrieb im Newsbeitrag news:2ab6a502050415181312665afb@mail.gmail.com... >> All that class and extend stuff some people are doing here is >> unnecessary, >> as far as I can tell. > > Once you have three or more methods, 'extend self' once makes for less > typing than 'self.' prepended to each method name. Is that a good > reason? You choose. It's different from a semantical point of view: if you make a module extend itself then you have those methods as instance methods (i.e. instances of classes that include this module) as well as class methods. If you just define them using def "sef.foo()..." then there are no instance methods. Personal note: I don't like the idiom "module X; ... extend self end" because it mixes module usage as mixin and namespace. You define instance methods only to conveniently define them as class methods. Using "module X; class<> Foo.bar => "class" >> X.new.bar => "instance" HTH Kind regards robert