From: gwtmp01@... Date: 2007-02-03T07:06:03+09:00 Subject: Re: Inject error when no default starting value given? On Feb 2, 2007, at 2:41 PM, Drew Olson wrote: > As you can see, if a default of 0 is not provided, inject returns an > instance of the Attendee class rather than the value in sum. Very > strange... You gave a Rails example, but it is really a generic Ruby question. If you don't give an argument to inject, it will use the first item in the collection as the starting accumulator: irb> [1,2,4].inject { |sum,i| p [sum,i]; sum + i } [1, 2] [3, 4] => 7