title: Wait until particular element to disappear
body: <p>Using Ruby, we can wait for particular element by doing following:</p>
  
  <pre><code>wait = Selenium::WebDriver::Wait.new(:timeout =&gt; 10)
  wait.until { driver.find_element(:class, 'gritter-item') }
  </code></pre>
  
  <p>but if I want particular element to disappear from DOM, I write method like:</p>
  
  <pre><code>  def disappear_element
      begin
        driver.find_element(:class, 'gritter-item')
      rescue Selenium::WebDriver::Error::NoSuchElementError
        true
      else
        false
      end
    end
  </code></pre>
  
  <p>and called it like:</p>
  
  <pre><code>wait.until { disappear_element }
  </code></pre>
  
  <p>This way I could achieve absence of element. Is there any better way in Ruby to achieve the same?</p>