Sha256: e7dd64785982040936480f54728a41b3b8abc1acb5baf9bd8da16878685e95a9

Contents?: true

Size: 144 Bytes

Versions: 5

Compression:

Stored size: 144 Bytes

Contents

module Enumerable #:nodoc:
  def first_match
    match = nil
    each do |items|
      break if match = yield(items)
    end
    match
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activesupport-1.2.1 lib/active_support/core_ext/enumerable.rb
activesupport-1.2.3 lib/active_support/core_ext/enumerable.rb
activesupport-1.2.5 lib/active_support/core_ext/enumerable.rb
activesupport-1.2.2 lib/active_support/core_ext/enumerable.rb
activesupport-1.2.4 lib/active_support/core_ext/enumerable.rb