instance method
Hash#include?
(K arg0) -> bool
include?(key) → true or false
hash.c
View on GitHub ↗
VALUE
rb_hash_has_key(VALUE hash, VALUE key)
{
return RBOOL(hash_stlike_lookup(hash, key, NULL));
}
Returns whether key is a key in self:
Example
h = {foo: 0, bar: 1, baz: 2} h.include?(:bar) # => true h.include?(:BAR) # => false
Related: Methods for Querying.