title: Ruby module_function, invoking module's private method, invoked in class method style on module shows error
body: <p><strong>test_module.rb</strong></p>
  
  <pre><code>  module MyModule
      def module_func_a
        puts "module_func_a invoked"
        private_b
      end
  
      module_function :module_func_a
  
      private
      def private_b
        puts "private_b invoked"
      end
    end
  
    class MyClass
      include MyModule
      def test_module
        module_func_a
      end
    end
  </code></pre>
  
  <p><strong>Invoking module function from class</strong></p>
  
  <pre><code>  c = MyClass.new
    c.test_module
  </code></pre>
  
  <p><strong>Output 1:</strong></p>
  
  <pre><code>$ ruby test_module.rb 
   module_func_a invoked
   private_b invoked
  </code></pre>
  
  <p><strong>Invoking module function on module in class method style</strong></p>
  
  <pre><code>ma = MyModule.module_func_a
  </code></pre>
  
  <p><strong>Output 2:</strong></p>
  
  <pre><code> module_func_a invoked
   test_module.rb:5:in `module_func_a': undefined local variable or method `private_b' for MyModule:Module (NameError)
   from test_module.rb:31
  </code></pre>
  
  <p>As can be seen from the Output 1 and Output 2 <i>when including the module in a class, no issue occurs when a module's private method gets invoked from a module function
  while in case when directly invoking the module function on the module in class method style the module's private method, invoked from module function, is not found.</i></p>
  
  <p>Can anybody make me understand the reason behind above behavior and whether invoking module function (which in turn invokes module's private method) on module in class method style is possible or not? If possible, then what rectifications are required in my code to do the same?</p>