ResolveMethod() публичный Метод

public ResolveMethod ( string name, VisibilityContext visibility ) : IronRuby.Runtime.Calls.MethodResolutionResult
name string
visibility IronRuby.Runtime.Calls.VisibilityContext
Результат IronRuby.Runtime.Calls.MethodResolutionResult
Пример #1
0
        public static RubyModule /*!*/ UndefineMethod(RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ methodName)
        {
            RubyMemberInfo method = self.ResolveMethod(methodName, true);

            if (method == null)
            {
                throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
            }
            self.UndefineMethod(methodName);
            return(self);
        }
Пример #2
0
        public static UnboundMethod /*!*/ GetInstanceMethod(RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ methodName)
        {
            RubyMemberInfo method = self.ResolveMethod(methodName, true);

            if (method == null)
            {
                throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
            }

            // unbound method binable to any class with "self" mixin:
            return(new UnboundMethod(self, methodName, method));
        }
Пример #3
0
 public static RubyModule /*!*/ UndefineMethod(RubyModule /*!*/ self, [DefaultProtocol, NotNullItems] params string[] /*!*/ methodNames)
 {
     foreach (var methodName in methodNames)
     {
         if (!self.ResolveMethod(methodName, VisibilityContext.AllVisible).Found)
         {
             throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
         }
         self.UndefineMethod(methodName);
     }
     return(self);
 }
Пример #4
0
        public static UnboundMethod /*!*/ GetInstanceMethod(RubyModule /*!*/ self, [DefaultProtocol, NotNull] string /*!*/ methodName)
        {
            RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;

            if (method == null)
            {
                throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
            }

            RubyModule constraint = self;

            if (self.IsSingletonClass && method.DeclaringModule != self)
            {
                constraint = ((RubyClass)self).SuperClass;
            }

            // unbound method binable to any class with "constraint" mixin:
            return(new UnboundMethod(constraint, methodName, method));
        }
Пример #5
0
        public static UnboundMethod/*!*/ GetInstanceMethod(RubyModule/*!*/ self, [DefaultProtocol]string/*!*/ methodName) {
            RubyMemberInfo method = self.ResolveMethod(methodName, true);
            if (method == null) {
                throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
            }

            // unbound method binable to any class with "self" mixin:
            return new UnboundMethod(self, methodName, method);
        }
Пример #6
0
 public static bool PublicMethodDefined(RubyModule/*!*/ self, [DefaultProtocol]string/*!*/ methodName) {
     RubyMemberInfo method = self.ResolveMethod(methodName, true);
     return method != null && method.Visibility == RubyMethodVisibility.Public;
 }
Пример #7
0
 public static RubyModule/*!*/ UndefineMethod(RubyModule/*!*/ self, [DefaultProtocol]string/*!*/ methodName) {
     RubyMemberInfo method = self.ResolveMethod(methodName, true);
     if (method == null) {
         throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
     }
     self.UndefineMethod(methodName);
     return self;
 }
Пример #8
0
        public static bool PublicMethodDefined(RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ methodName)
        {
            RubyMemberInfo method = self.ResolveMethod(methodName, true);

            return(method != null && method.Visibility == RubyMethodVisibility.Public);
        }
Пример #9
0
        public static UnboundMethod/*!*/ GetInstanceMethod(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
            RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;
            if (method == null) {
                throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
            }

            RubyModule constraint = self;
            if (self.IsSingletonClass && method.DeclaringModule != self) {
                constraint = ((RubyClass)self).SuperClass;
            }

            // unbound method binable to any class with "constraint" mixin:
            return new UnboundMethod(constraint, methodName, method);
        }
Пример #10
0
        public static bool PublicMethodDefined(RubyModule /*!*/ self, [DefaultProtocol, NotNull] string /*!*/ methodName)
        {
            RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;

            return(method != null && method.Visibility == RubyMethodVisibility.Public);
        }
Пример #11
0
 public static bool PublicMethodDefined(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
     RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;
     return method != null && method.Visibility == RubyMethodVisibility.Public;
 }
Пример #12
0
 public static RubyModule/*!*/ UndefineMethod(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
     if (!self.ResolveMethod(methodName, VisibilityContext.AllVisible).Found) {
         throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
     }
     self.UndefineMethod(methodName);
     return self;
 }
Пример #13
0
 public static bool ProtectedMethodDefined(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
     RubyMemberInfo method = self.ResolveMethod(methodName, RubyClass.IgnoreVisibility).Info;
     return method != null && method.Visibility == RubyMethodVisibility.Protected;
 }
Пример #14
0
 public static RubyModule/*!*/ UndefineMethod(RubyModule/*!*/ self, [DefaultProtocol]string/*!*/ methodName) {
     if (!self.ResolveMethod(methodName, true).Found) {
         throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
     }
     self.UndefineMethod(methodName);
     return self;
 }
Пример #15
0
 public static RubyModule UndefineMethod(RubyModule/*!*/ self, [DefaultProtocol, NotNullItems]params string[]/*!*/ methodNames)
 {
     foreach (var methodName in methodNames) {
         if (!self.ResolveMethod(methodName, VisibilityContext.AllVisible).Found) {
             throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
         }
         self.UndefineMethod(methodName);
     }
     return self;
 }