title: How do I pass a statement as an argument?
body: <p>Specifically in ruby, I'm wondering if I am able to do something.</p>
  
  <p>Let's say I have a while loop that does something until a condition is no longer met.
  I will be needing this same while loop for multiple purposes but the condition changes every time. Thus I want change it to a function for re-usability purposes.</p>
  
  <p>Is it possible for me to pass (what condition I'm checking for) as an argument?</p>
  
  <p>Something like:</p>
  
  <pre><code>def wait(condition)
    while condition
      do something
    end
  end
  </code></pre>
  
  <p>To clarify, I want to pass the condition (or statement) itself, not the evaluation of the statement at the time of running the function.
  Also I'm pretty sure I'm giving these the wrong names (statement/condition/evaluation) so please correct me if I'm mistaken.</p>