title: Add method to an instanced object
body: <pre><code>obj = SomeObject.new
  
  def obj.new_method
    "do some things"
  end
  
  puts obj.new_method
  &gt; "do some things"
  </code></pre>
  
  <p>This works ok. However, I need to do same thing inside an existing method:</p>
  
  <pre><code>def some_random_method
    def obj.new_method
      "do some things"
    end
  end
  </code></pre>
  
  <p>Works ok as well, but having a method inside a method looks pretty horrible. The question is, is there any alternate way of adding such a method?</p>