finding an element in an array without using include? : <p>I have an array of objects in which I need to check if it meets a specific criteria. </p>

<p>What I've done is looped through the array and then matched it with the ruby <code>include?</code> object.  Problem is I've noticed that there are instances where this causes some codes to return true, when they really should be returning false. </p>

<pre><code>group.plan_codes.each do |code|
   normalized_plan_code = code.upcase.gsub(" ", "").gsub("+", "")
   normalized_plan_code.include? coverage['plan_description'].upcase.gsub(" ", "").gsub("+", "")
end
</code></pre>

<p>I'm basically taking these <code>group.plan_codes</code> and matching them with the <code>coverage['plan_description']</code>.  Problem I found was that if the code was something like <code>group plan</code> submitting a code like <code>not group plan</code> would still return true because the <code>group plan</code> is included in the <code>plan description</code></p>

<p>Would anyone know a better way about doing this? I was thinking it could stop looking after the first element is completed, but am a little caught up on the ruby <code>detect</code></p>
