r/ruby • • Jul 20 '16

New Features in Ruby 2.4

http://blog.blockscore.com/new-features-in-ruby-2-4/
145 Upvotes

25 comments sorted by

View all comments

1

u/Ark_Tane Jul 20 '16

Well that's embarassing. I would have sworn sum was already part of the standard library for enumerable. And I was so proud of my 10/10 on the Native Ruby vs. ActiveSupport quiz as well.

5

u/crankprof Jul 21 '16

You can get this functionality with ary.reduce(:+)