clazz.addMethod(name, newMethod);
//System.out.println("Added " + name + " to " + clazz + "; self is " + self);
if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
clazz.getSingletonClass().addMethod(name, new WrapperMethod(clazz.getSingletonClass(), newMethod, Visibility.PUBLIC));
clazz.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(name));
}
// 'class << state.self' and 'class << obj' uses defn as opposed to defs
if (clazz.isSingleton()) {
((MetaClass) clazz).getAttached().callMethod(context, "singleton_method_added", runtime.fastNewSymbol(name));