title: Ruby: Does defining a method inside another method have any real uses?
body: <p>I was reading an article on meta-programming and it showed that you can define a method within another method. This is something that I had known for a while, but it made me ask myself the question: does this have any practical application? Is there any real life uses of defining a method within a method?</p>
  
  <p>Ex:</p>
  
  <pre><code>def outer_method
    def inner_method
       # ...
    end
    # ...
   end
  </code></pre>