Doing a `key` call on a Hash is slow since it has to enumerate all values.  If this is a common call in this class, you should store a value => key reverse Hash also, or since you don't actually care about the key value, you should add a Set of values and do an include? check on the Set.