Even idiomatic usage of a language can end up looking a bit like code golf. Inject in Ruby is a good example.
If you need to do something in a loop that produces a single value, such as a sum, consider using the inject method. This can take a little getting used to.