There's no built in method to do that. You can do it with:

hash = { :a => 1, :b => 6, :c => 20 }

p hash.inject(0) { |sum, tuple| sum += tuple[1] } # => 27

On Tuesday, March 22, 2011 01:57:27 pm Jen wrote:
> Hi,
> 
> Is there an inbuilt method to sum all values in a hash and return the
> result?
> 
> I.E something like puts hash[values].sum
> 
> If so could someone please point me at the correct section of the ruby
> docs?
> 
> thanks,
> Jen.