Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/money_extensions/array.rb
Instance Method Summary collapse
-
#total_money ⇒ Object
Returns sum as a money - and returns 0 for empty arrays.
Instance Method Details
#total_money ⇒ Object
Returns sum as a money - and returns 0 for empty arrays
5 6 7 |
# File 'lib/money_extensions/array.rb', line 5 def total_money empty? ? ::Money.new(0) : inject(:+) end |