instance method
Set#===
(untyped other) -> bool
===(p1)
set.c
View on GitHub ↗
static VALUE
set_i_include(VALUE set, VALUE item)
{
return RBOOL(RSET_IS_MEMBER(set, item));
}
Alias of #include?
Returns true if the set contains the given object:
Example
Set[1, 2, 3].include? 2 #=> true Set[1, 2, 3].include? 4 #=> false
Note that include? and member? do not test member equality using == as do other Enumerables.
This is aliased to ===, so it is usable in case expressions:
Example
case :apple when Set[:potato, :carrot] "vegetable" when Set[:apple, :banana] "fruit" end # => "fruit"
See also Enumerable#include?