title: How to check that all elements of one array are greater than their counterparts in a parallel array (in Ruby).
body: <p>I am trying to compare two arrays to ensure that the corresponding values of one is always greater than the other.</p>
  
  <pre><code>a = [2, 3, 4]
  b = [1, 2, 3]
  
  # a[0] &gt; b[0] ... a[x] &gt; b[x]
  </code></pre>
  
  <p>At this point I am thinking of using <code>inject</code> with an index and return if the comparison fails, like:</p>
  
  <pre><code>b.each_with_index.inject(true) do |cmp, (element,index)|
    if element &gt; a[index] do
      cmp = false
      return
    end
  end
  </code></pre>
  
  <p>Is there a better way of doing this? Kinda feeling like Ruby or Rails might already have something like this built-in and I missed it.</p>