Sha256: 3ec49d265f443f851adf655dbfe76220a89a63d235b20037e42d62e5beb14a65

Contents?: true

Size: 232 Bytes

Versions: 31

Compression:

Stored size: 232 Bytes

Contents

# encoding: utf-8

# Array
class Array
  # alias of Array#reduce(&:+)
  #
  # === Example
  #
  #   [*1..5].reduce(&:+) # => 15
  #   [*'a'..'z'].reduce(&:+) # => 'abcdefghijklmnopqrstuvwxyz'
  #
  def sum
    reduce(&:+)
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
tbpgr_utils-0.0.130 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.129 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.128 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.127 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.126 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.125 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.124 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.123 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.122 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.121 lib/open_classes/array/sum.rb
tbpgr_utils-0.0.120 lib/open_classes/array/sum.rb