Method: Object#===
- Defined in:
- object.c
#===(other) ⇒ Boolean
Case Equality – For class Object, effectively the same as calling #==, but typically overridden by descendants to provide meaningful semantics in case statements.
131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'object.c', line 131
VALUE
rb_equal(VALUE obj1, VALUE obj2)
{
VALUE result;
if (obj1 == obj2) return Qtrue;
result = rb_equal_opt(obj1, obj2);
if (result == Qundef) {
result = rb_funcall(obj1, id_eq, 1, obj2);
}
if (RTEST(result)) return Qtrue;
return Qfalse;
}
|