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