public bool EnumerateMethods(Func<RubyModule, string, RubyMemberInfo, bool>/*!*/ action) {
Context.RequiresClassHierarchyLock();
InitializeMethodsNoLock();
foreach (KeyValuePair<string, RubyMemberInfo> method in _methods) {
// Exclude attached CLR members as they only represent cached CLR method calls and these methods are enumerated below.
// Include undefined and CLR hidden members - the action uses them to hide the names.
if (method.Value.IsRubyMember) {
if (action(this, method.Key, method.Value)) {
return true;
}
}
}
// CLR members (do not include interface members - they are not callable methods, just metadata):
if (_typeTracker != null && !IsModuleType(_typeTracker.Type)) {
foreach (string name in EnumerateClrMembers(_typeTracker.Type)) {
if (action(this, name, RubyMemberInfo.InteropMember)) {
return true;
}
}
}
return false;
}