title: Call method only if it exists
body: <p>Is there some hidden Ruby/Rails-magic for simply calling a method only if it exists?</p>
  
  <p>Lets say I want to call</p>
  
  <pre><code>resource.phone_number
  </code></pre>
  
  <p>but I don't know beforehand if resource responds to <code>phone_number</code>. A way to do this is</p>
  
  <pre><code>resource.phone_number if resource.respond_to? :phone_number
  </code></pre>
  
  <p>That's not all that pretty if used in the wrong place. I'm curious if something exists that works more along the lines of how <code>try</code> is used (<code>resource.try(:phone_number)</code>).</p>