==(p1)
public
Two method objects are equal if that are bound to the same object and
contain the same body.
Show source
static VALUE
method_eq(VALUE method, VALUE other)
{
struct METHOD *m1, *m2;
if (TYPE(other) != T_DATA
|| RDATA(other)->dmark != (RUBY_DATA_FUNC) bm_mark)
return Qfalse;
if (CLASS_OF(method) != CLASS_OF(other))
return Qfalse;
Data_Get_Struct(method, struct METHOD, m1);
Data_Get_Struct(other, struct METHOD, m2);
if (m1->oclass != m2->oclass || m1->rclass != m2->rclass ||
m1->recv != m2->recv || m1->body != m2->body)
return Qfalse;
return Qtrue;
}