From: James Hunt Date: 2007-09-09T17:39:35+09:00 Subject: Re: module_function :func vs. MyModule.func? On 9/9/07, 7stud -- wrote: > Using your last example with module_function, I get the same result: > > module MyModule > def greet > puts "hello" > end > > module_function :greet > end > > class MyClass > include MyModule > end > > MyModule.greet > MyClass.new.greet > > > --output:-- > hello > r1test.rb:13: private method `greet' called for # > (NoMethodError) > > So, I'm not seeing any difference. > -- > Posted via http://www.ruby-forum.com/. > > If you look at my code, the MyClass definition creates an instance method called hello that calls the private greet method. In the Explicit example, greet just doesn't exist in MyExplicitClass after the mixin... -- James