From: 7stud -- Date: 2007-09-09T15:06:42+09:00 Subject: Re: module_function :func vs. MyModule.func? 7stud -- wrote: > > module MyModule > def greet > puts "hello" > end > end > > module OtherModule > include MyModule > > module_function :greet > end > > OtherModule.greet On p. 355 of "Programming Ruby (2nd ed)", there is the equivalent of this example: module MyModule def greet puts "hello" end module_function :greet end MyModule.greet As far as I can tell, in that example the module_function has no purpose since I could just as easily make this change: module MyModule def MyModule.greet puts "hello" end end MyModule.greet Is there any reason to use module_function in that example? -- Posted via http://www.ruby-forum.com/.