matz / netlab.co.jp (Yukihiro Matsumoto) writes:

>   module Dave
>     def dave
>       # ..
>     end
>     module_function :dave
>   end
> 
> works like
>   
>   module Dave
>     def dave
>       # ..
>     end
>     private :dave       # method visibitili change
>     def Dave.dave       # copies method body for class method
>       # ..
>     end
>   end
> 
> See?

Yup! Thanks. I get it now - that's quite tricky. It means that module
methods become functions when included.

It there a reason that the body is copied, rather than aliased. It
leads to some interesting side-effects:


     module Dave
      def fred
       puts "FRED"
      end
      module_function :fred
      def fred 
       puts "fred"
      end
     end

     include Dave
     fred
     Dave.fred

Dave