Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Hash#value?
(top value) -> bool
value?(p1)
hash.c
View on GitHub ↗
static VALUE
rb_hash_has_value(VALUE hash, VALUE val)
{
VALUE data[2];
data[0] = Qfalse;
data[1] = val;
rb_hash_foreach(hash, rb_hash_search_value, (VALUE)data);
return data[0];
}
Alias of #has_value?
Returns whether value is a value in self.
Related: Methods for Querying.