On Sun, 2004-10-03 at 11:34, gabriele renzi wrote: > Mauricio Fernández ha scritto: > > >>def g; puts 'g'; end > > > > ^^^ > > def self.g or better module_function :g too > > why better module_function ? Why is it needed or why is module_function a better way to define it than "def self."? I can answer the first: if you don't do one or the other of them the module won't be able to see "g" (and thus f will fail with a name error) since g will only be defined for instances of classes that include the module. As for the second, I'd have to guess that he was expressing a stylist preference, but that is only a guess. -- MarkusQ