title: Ruby: toggle a boolean inline?
body: <p>How can I get the opposite of a boolean in Ruby (I know that it is converted to 0/1) using a method inline?</p>
  
  <p>say I have the given instance:</p>
  
  <pre><code>class Vote
  
    def return_opposite
      self.value
    end
  
  end
  </code></pre>
  
  <p>Which obviously doesn't do anything, but I can't seem to find a method that is simple and short something like <code>opposite()</code> or the like. Does something like this exist and I'm just not looking at the right place in the docs? If one doesn't exist is there a really short ternary that would toggle it from 1 => 0 or 0 => 1?</p>