Why don't you use inject? That's exactly what it does: gets an initial value (ContentData.new in this case) and returns it after all calculations.