Module: Enumerable

Defined in:
lib/active_support/core_ext/enumerable.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#first_matchObject


2
3
4
5
6
7
8
# File 'lib/active_support/core_ext/enumerable.rb', line 2

def first_match
  match = nil
  each do |items|
    break if match = yield(items)
  end
  match
end