public void ForEachInstanceMethod(bool inherited, Func<RubyModule/*!*/, string/*!*/, RubyMemberInfo, bool>/*!*/ action) {
Context.RequiresClassHierarchyLock();
ForEachAncestor(inherited, delegate(RubyModule/*!*/ module) {
// Skip CLR modules (methods declared on CLR modules have already been looked for in the class).
// If 'this' is a CLR module, we want to visit all mixed-in methods.
if (module.IsClrModule && !this.IsClrModule) return false;
// notification that we entered the module (it could have no method):
if (action(module, null, null)) return true;
return module.EnumerateMethods(action);
});
}