title: Ruby Detect method
body: <p>Select makes sense. But can someone explain .detect to me? I don't understand these data.</p>
  
  <pre><code>&gt;&gt; [1,2,3,4,5,6,7].detect { |x| x.between?(3,4) }
  =&gt; 3
  &gt;&gt; [1,2,3,4,5,6,7].detect { |x| x.between?(3,6) }
  =&gt; 3
  &gt;&gt; [1,2,3,4,5,6,7].detect { |x| x.between?(3,7) }
  =&gt; 3
  &gt;&gt; [1,2,3,4,5,6,7].detect { |x| x.between?(2,7) }
  =&gt; 2
  &gt;&gt; [1,2,3,4,5,6,7].detect { |x| x.between?(1,7) }
  =&gt; 1
  &gt;&gt; [1,2,3,4,5,6,7].detect { |x| x.between?(6,7) }
  =&gt; 6
  &gt;&gt; [1,2,3,4,5,6,7].select { |x| x.between?(6,7) }
  =&gt; [6, 7]
  &gt;&gt; [1,2,3,4,5,6,7].select { |x| x.between?(1,7) }
  =&gt; [1, 2, 3, 4, 5, 6, 7]
  </code></pre>