I have a piece of code that does something like this:
module M
def foo; end
module_function :foo
end
class Foo
include M
end
Foo.new.foo()
and was very surprised to discover that it doesn't work:
NameError: private method `foo' called for #<Foo:0x402db40c>
from (irb):10
Why does module_function() make foo() private?
Paul