>>>>> "C" == Carmine Moleti <carmineaskme / askme.ask> writes:

C> Why the line "temp.metodo1()" gives the error:
C> "Private method 'metodo1' called for..." ?

 module_function make the method private (i.e. a method which can't be
 called with a receiver) and create a public method for the singleton class

C> The Pickaxe book states that using "Module#module_function" actually 
C> makes a copy of the methods and not an alias.

 The book is trying to say this

   module Mod
      def meth
         puts "meth"
      end
   
      module_function :meth
   
      def meth
         puts "new_meth"
      end
   end
   
   include Mod
   
   Mod.meth  # meth
   meth      # new_meth

 if module_function just created an alias, the 2 calls will give the same
 output


Guy Decoux