title: Can I monkey patch NilClass to return nil for missing methods?
body: <p>In other languages like (objective-c for example) calling a method on a nil object fails silently and returns nil but in ruby you get errors like this...</p>
  <pre><code>undefined method `some_method' for nil:NilClass
  </code></pre>
  <p>which (for me) results in code like this:</p>
  <pre><code>if some_object &amp;&amp; some_object.cool?  # instead of if some_object.cool?
    # do some cool stuff
  end
  </code></pre>
  <p>or</p>
  <pre><code>some_object.do_awsome_thing if some_object
  </code></pre>
  <p>Which all seems backwards and weird.</p>
  <h2>Two questions</h2>
  <ol>
  <li><p>What am I doing wrong, what's the correct way to deal with having the possibility of a nil object</p>
  </li>
  <li><p>What kinds of awful awful things would happen if I just monkey patched the nil object to return nil for missing_methods?</p>
  </li>
  </ol>
  <p>IE:</p>
  <pre><code>class NilClass
    def missing_method
      nil
    end
  end
  </code></pre>