method

key

v1_9_2_180 - Show latest stable - Class: Hash
key(p1)
public

Returns the key for a given value. If not found, returns nil.

h = { "a" => 100, "b" => 200 }
h.key(200)   #=> "b"
h.key(999)   #=> nil