Method: Comparable#==
- Defined in:
- compar.c
#==(other) ⇒ Boolean
Compares two objects based on the receiver’s <=> method, returning true if it returns 0. Also returns true if obj and other are the same object.
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'compar.c', line 78 static VALUE cmp_equal(VALUE x, VALUE y) { VALUE c; if (x == y) return Qtrue; c = rb_exec_recursive_paired_outer(cmp_eq_recursive, x, y, y); if (NIL_P(c)) return Qfalse; if (rb_cmpint(c, x, y) == 0) return Qtrue; return Qfalse; } |