If I have a method like:
def sum *numbers
numbers.inject{|sum, number| sum += number}
end
How would I be able to pass an array as numbers?
ruby-1.9.2-p180 :044 > sum 1,2,3 #=> 6
ruby-1.9.2-p180 :045 > sum([1,2,3]) #=> [1, 2, 3]
Note that I can't change the sum method to accept an array.