singleton_method_added(p1)
public
Show source
/*
* Trap attempts to add methods to <code>Numeric</code> objects. Always
* raises a <code>TypeError</code>
*/
static VALUE
num_sadded(x, name)
VALUE x, name;
{
ruby_frame = ruby_frame->prev; /* pop frame for "singleton_method_added" */
/* Numerics should be values; singleton_methods should not be added to them */
rb_raise(rb_eTypeError,
"can't define singleton method \"%s\" for %s",
rb_id2name(rb_to_id(name)),
rb_obj_classname(x));
return Qnil; /* not reached */
}