Sha256: 07f9c433667693d328aed792de3fb1320d9018890c0f764afaec218a96cb01bb

Contents?: true

Size: 379 Bytes

Versions: 8

Compression:

Stored size: 379 Bytes

Contents

module Percheron
  module CoreExtensions
    module Array
      module Returning
        def return
          result = nil
          each do |x|
            r = yield(x)
            if r
              result = r
              break
            end
          end
          result
        end
      end
    end
  end
end

Array.include(Percheron::CoreExtensions::Array::Returning)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
percheron-0.3.2 lib/percheron/core_extensions.rb
percheron-0.3.1 lib/percheron/core_extensions.rb
percheron-0.3.0 lib/percheron/core_extensions.rb
percheron-0.2.4 lib/percheron/core_extensions.rb
percheron-0.2.3 lib/percheron/core_extensions.rb
percheron-0.2.2 lib/percheron/core_extensions.rb
percheron-0.2.1 lib/percheron/core_extensions.rb
percheron-0.2.0 lib/percheron/core_extensions.rb