title: how can i compress and increase performanceof this loop?
body: <p>Ruby on Rails:
  from URL i want to get a specific value,  for that one i am checking  whether the url containing that value or not using an array. if it has that value i am splitting url and returning value.</p>
  
  <pre><code>@url = 'http://fruits.com/A15/abc1234-apple-w740_h550_q58.jpg'
  
  ['apple','banana','grape','butter','honey'].each do |fruit|
    if (@url.include? fruit) 
      return @url.split(fruit)[1].freeze 
    end
  end
  </code></pre>
  
  <p>i don't want to loop 5 times..
  question is how can i compress this loop.</p>