Sha256: 5b8309f81c05f051dafe9f22b04db7ae0dac0d35c594878041529c1a719a3d74

Contents?: true

Size: 173 Bytes

Versions: 15

Compression:

Stored size: 173 Bytes

Contents

module Enumerable
  def sum(accumulator = 0, &block)
    values = block_given? ? map(&block) : self
    values.inject(accumulator, :+)
  end unless method_defined? :sum
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/backports-3.12.0/lib/backports/2.4.0/enumerable/sum.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/backports-3.15.0/lib/backports/2.4.0/enumerable/sum.rb
backports-3.15.0 lib/backports/2.4.0/enumerable/sum.rb
backports-3.14.0 lib/backports/2.4.0/enumerable/sum.rb
backports-3.13.0 lib/backports/2.4.0/enumerable/sum.rb
backports-3.12.0 lib/backports/2.4.0/enumerable/sum.rb
backports-3.11.4 lib/backports/2.4.0/enumerable/sum.rb
backports-3.11.3 lib/backports/2.4.0/enumerable/sum.rb
backports-3.11.2 lib/backports/2.4.0/enumerable/sum.rb
backports-3.11.1 lib/backports/2.4.0/enumerable/sum.rb
backports-3.11.0 lib/backports/2.4.0/enumerable/sum.rb
backports-3.10.3 lib/backports/2.4.0/enumerable/sum.rb
backports-3.10.2 lib/backports/2.4.0/enumerable/sum.rb
backports-3.10.1 lib/backports/2.4.0/enumerable/sum.rb
backports-3.10.0 lib/backports/2.4.0/enumerable/sum.rb