title: Using code block in ruby's if statement
body: <p>is there a way to pass a code block as a ruby if condition?</p>
  
  <p>I have a list of regular expressions and I want to check if a message matches any of them and then do something accordingly or else do something different.</p>
  
  <p>Here is an example snippet for how I think it should be written:</p>
  
  <pre><code>msg_values.each do |msg|
      if (SKIP_MSG_ARRAY.each { |regular_exp| return true if msg.match(regular_exp)})
          # do something
      else
          # do something else
      end        
  end
  </code></pre>
  
  <p>is it possible? or else what is the best way of writing something like this?</p>