How to sum properties of the objects within an array in Ruby April 10, 2023 by Tarik array.map(&:cash).inject(0, &:+) or array.inject(0){|sum,e| sum + e.cash }