GetTargetClass() public méthode

public GetTargetClass ( ) : RubyClass
Résultat RubyClass
Exemple #1
0
        public static RubyMethod /*!*/ DefineMethod(RubyModule /*!*/ self,
                                                    [DefaultProtocol] string /*!*/ methodName, [NotNull] RubyMethod /*!*/ method)
        {
            // MRI 1.8 does the check when the method is called, 1.9 checks it upfront as we do:
            var targetClass = method.GetTargetClass();

            if (!self.HasAncestor(targetClass))
            {
                throw RubyExceptions.CreateTypeError(
                          String.Format("bind argument must be a subclass of {0}", targetClass.Name)
                          );
            }

            self.AddDefinedMethod(methodName, method.Info);
            return(method);
        }
Exemple #2
0
 public static RubyMethod /*!*/ DefineMethod(RubyScope /*!*/ scope, RubyModule /*!*/ self,
                                             [DefaultProtocol, NotNull] string /*!*/ methodName, [NotNull] RubyMethod /*!*/ method)
 {
     DefineMethod(scope, self, methodName, method.Info, method.GetTargetClass());
     return(method);
 }
Exemple #3
0
 public static UnboundMethod /*!*/ Unbind(RubyMethod /*!*/ self)
 {
     return(new UnboundMethod(self.GetTargetClass(), self.Name, self.Info));
 }
Exemple #4
0
 public static MutableString /*!*/ ToS(RubyContext /*!*/ context, RubyMethod /*!*/ self)
 {
     return(UnboundMethod.ToS(context, self.Name, self.Info.DeclaringModule, self.GetTargetClass(), "Method"));
 }
Exemple #5
0
 public static UnboundMethod/*!*/ Unbind(RubyMethod/*!*/ self) {
     return new UnboundMethod(self.GetTargetClass(), self.Name, self.Info);
 }
Exemple #6
0
 public static MutableString/*!*/ ToS(RubyContext/*!*/ context, RubyMethod/*!*/ self) {
     return UnboundMethod.ToS(context, self.Name, self.Info.DeclaringModule, self.GetTargetClass(), "Method");
 }