title: Converting an empty string into nil in Ruby
body: <p>I have a string called <code>word</code> and a function called <code>infinitive</code> such that<br>
  <code>word.infinitive</code> would return another string on some occasions and an empty string otherwise<br>
  I am trying to find an elegant ruby one line expression for the code-snippet below  </p>
  
  <pre><code>if word.infinitive == ""
        return word
  else return word.infinitive
  </code></pre>
  
  <p>Had infinitive returned nil instead of "", I could have done something like</p>
  
  <pre><code>(word.infinitive or word)
  </code></pre>
  
  <p>But since it does not, I can't take advantage of the short-circuit OR<br>
  Ideally I would want<br>
  1) a single expression that I could easily embed in other code<br>
  2) the function infinitive being called only once<br>
  3) to not add any custom gems or plugins into my code</p>