class Array
Public Instance Methods
sum_with_identity(identity = 0, &block)
click to toggle source
# File lib/reclassifier/core_ext/array.rb, line 2 def sum_with_identity(identity = 0, &block) return identity unless size > 0 if block_given? map(&block).sum else reduce(:+) end end