How to find the key of the largest value hash?

This will return max hash key-value pair depending on the value of hash elements:

def largest_hash_key(hash)
  hash.max_by{|k,v| v}
end

I found this way , return the key of the first max value

hash.key(hash.values.max)