title: Ruby " yield row if block_given?"
body: <pre><code>  # Get our data back
    def queryNewsTable
      @conn.exec( "SELECT * FROM newslib" ) do |result|
        result.each do |row|
          yield row if block_given?
        end
      end
    end
  </code></pre>
  
  <p>For this piece of code. I don't quite understand  <code>yield row if block_given?</code></p>
  
  <p>can anybody point to any good article teaching about this or you can briefly explain it to me a little bit
  thanks so much</p>