Class: Module

Inherits:
Object show all
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



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'ext/appmap/appmap.c', line 38

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);
}