Class: Module
- Includes:
- AppMap::ModuleMethods
- Defined in:
- lib/appmap/hook/method.rb
Instance Method Summary collapse
Instance Method Details
#define_method_with_arity(name, arity, proc) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'ext/appmap/appmap.c', line 45
static VALUE
am_define_method_with_arity(VALUE mod, VALUE name, VALUE arity, VALUE proc)
{
VALUE arities_key = rb_intern(ARITIES_KEY);
VALUE arities = rb_ivar_get(mod, arities_key);
if (arities == Qundef || NIL_P(arities)) {
arities = rb_hash_new();
rb_ivar_set(mod, arities_key, arities);
}
rb_hash_aset(arities, name, arity);
return rb_funcall(mod, rb_intern("define_method"), 2, name, proc);
}
|