aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/enumerable.rb
blob: 497ca52c2de2a6c47c51adf9e7d1c65badeb706a (plain) (blame)
1
2
3
4
5
6
7
8
9
module Enumerable
  def first_match
    match = nil
    each do |items|
      break if match = yield(items)
    end
    match
  end
end