Cleaning Arrays of Arrays which consist of nils
<p>For example I have an array:</p>

<p></p>

<pre><code>[[nil, nil], [1, 2], [nil, nil], [nil, nil]] 
</code></pre>

<p>What is the best way to clean it? Array must have only arrays which do not consist of nil. After cleaning it has to be:</p>

<p></p>

<pre><code>[[1,2]]
</code></pre>

<p>Something like:</p>

<p></p>

<pre><code>[[nil, nil], [1, 2], [nil, nil], [nil, nil]].each {|x| x - [nil]} 
</code></pre>