title: defining a `module_function` and later overriding the same method: how many methods exist?
body: <p><strong>Main Question:</strong> In the <a href="https://apidock.com/ruby/Module/module_function" rel="nofollow noreferrer">Ruby API docs</a> for the <code>module_function</code> method, I see the following code example:</p>
  
  <pre><code>module Mod
    def one
      "This is one"
    end
    module_function :one
  end
  
  class Cls
    include Mod
    def call_one
      one
    end
  end
  
  Mod.one     #=&gt; "This is one"
  c = Cls.new
  c.call_one  #=&gt; "This is one"
  
  module Mod
    def one
      "This is the new one"
    end
  end
  
  Mod.one     #=&gt; "This is one"
  c.call_one  #=&gt; "This is the new one"
  </code></pre>
  
  <p>If I'm reading this code right, I see the following:</p>
  
  <ol>
  <li>A module is defined named <code>Mod</code>, along with a method named <code>one</code>.  The <code>module_function</code> method is then called, passing the name of this method as the param.</li>
  <li>A class is defined named <code>Cls</code>, and the <code>Mod</code> module is included in this class, giving the class access to the method defined inside <code>Mod</code>.  Then a wrapper method is created, which just delegates its call to the module method.</li>
  <li>The module method is called directly, and the wrapper method is called on a new instance of the class.  Both calls return the same thing.</li>
  </ol>
  
  <p>After that point is where I get confused.  The module is then re-opened and a new implementation of the <code>one</code> method is created.  Then the two original method calls (the module call and the class instance call) are performed again, this time with different outputs.</p>
  
  <p>If two different outputs are being displayed from the respective method calls, this implies that there must now be two different methods with the same name in the module.  Am I correct about that?</p>
  
  <p><strong>Related Question:</strong> out of curiosity, I tried the following code, but it didn't produce the same results:</p>
  
  <pre><code>module Sprocket
    def create
      "Sprocket"
    end
  
    module_function 
  
    def create
      "Sprocket 2.0"
    end
  end
  
  class SprocketFactory
    include Sprocket
  
    def make
      create
    end
  end
  
  p Sprocket.create             #=&gt; "Sprocket 2.0"
  p SprocketFactory.new.make    #=&gt; "Sprocket 2.0"
  </code></pre>
  
  <p>Therefore, what would the API example code look like if the two <code>one</code> methods had been defined at the same time (instead of re-opening the module, as was done in the docs)?  Or is such a thing not possible?</p>