public static RubyMethod/*!*/ Bind(UnboundMethod/*!*/ self, object target) { RubyContext ec = self._targetConstraint.Context; if (!ec.GetClassOf(target).HasAncestor(self._targetConstraint)) { throw RubyExceptions.CreateTypeError( String.Format("bind argument must be an instance of {0}", self._targetConstraint.Name) ); } return new RubyMethod(target, self._info, self._name); }
public static RubyMethod/*!*/ Bind(UnboundMethod/*!*/ self, object target) { RubyContext context = self._targetConstraint.Context; if (!context.IsKindOf(target, self._targetConstraint)) { throw RubyExceptions.CreateTypeError( String.Format("bind argument must be an instance of {0}", self._targetConstraint.GetName(context)) ); } return new RubyMethod(target, self._info, self._name); }
public static RubyMethod /*!*/ Bind(UnboundMethod /*!*/ self, object target) { RubyContext ec = self._targetConstraint.Context; if (!ec.GetClassOf(target).HasAncestor(self._targetConstraint)) { throw RubyExceptions.CreateTypeError( String.Format("bind argument must be an instance of {0}", self._targetConstraint.Name) ); } return(new RubyMethod(target, self._info, self._name)); }
public static RubyMethod /*!*/ Bind(UnboundMethod /*!*/ self, object target) { RubyContext context = self._targetConstraint.Context; if (!context.IsKindOf(target, self._targetConstraint)) { throw RubyExceptions.CreateTypeError( "bind argument must be an instance of {0}", self._targetConstraint.GetName(context) ); } return(new RubyMethod(target, self._info, self._name)); }
public static bool Equal(UnboundMethod/*!*/ self, object other) { return false; }
public static bool Equal(UnboundMethod/*!*/ self, [NotNull]UnboundMethod/*!*/ other) { return ReferenceEquals(self.Info, other.Info); }
public static UnboundMethod /*!*/ SelectOverload(RubyContext /*!*/ context, UnboundMethod /*!*/ self, [NotNullItems] params object /*!*/[] /*!*/ parameterTypes) { return(new UnboundMethod(self.TargetConstraint, self.Name, MethodOps.SelectOverload(context, self.Info, self.Name, parameterTypes))); }
public static UnboundMethod /*!*/ DefineMethod(RubyScope /*!*/ scope, RubyModule /*!*/ self, [NotNull] ClrName /*!*/ methodName, [NotNull] UnboundMethod /*!*/ method) { var result = DefineMethod(scope, self, methodName.MangledName, method); if (methodName.HasMangledName) { self.AddMethodAlias(methodName.ActualName, methodName.MangledName); } return(result); }
public static MutableString /*!*/ ToS(RubyContext /*!*/ context, RubyMethod /*!*/ self) { return(UnboundMethod.ToS(context, self.Name, self.Info.DeclaringModule, self.GetTargetClass(), "Method")); }
public static UnboundMethod SelectOverload(RubyContext/*!*/ context, UnboundMethod/*!*/ self, [NotNullItems]params object/*!*/[]/*!*/ parameterTypes) { return new UnboundMethod(self.TargetConstraint, self.Name, MethodOps.SelectOverload(context, self.Info, self.Name, parameterTypes)); }
public static RubyArray GetParameters(UnboundMethod/*!*/ self) { return self.Info.GetRubyParameterArray(); }
public static int GetArity(UnboundMethod /*!*/ self) { return(self.Info.GetArity()); }
public static bool Equal(UnboundMethod /*!*/ self, [NotNull] UnboundMethod /*!*/ other) { return(ReferenceEquals(self.Info, other.Info)); }
public static bool Equal(UnboundMethod /*!*/ self, object other) { return(false); }
public static RubyArray /*!*/ GetParameters(UnboundMethod /*!*/ self) { return(self.Info.GetRubyParameterArray()); }
public static RubyArray GetSourceLocation(UnboundMethod /*!*/ self) { return(GetSourceLocation(self.Info)); }
public static RubyArray /*!*/ GetClrMembers(UnboundMethod /*!*/ self) { return(new RubyArray(self.Info.GetMembers())); }
public static int GetArity(UnboundMethod/*!*/ self) { return self.Info.GetArity(); }
public static UnboundMethod /*!*/ Clone(UnboundMethod /*!*/ self) { return(new UnboundMethod(self._targetConstraint, self._name, self._info)); }
public static RubyArray GetClrMembers(UnboundMethod/*!*/ self) { return new RubyArray(self.Info.GetMembers()); }
public static MutableString /*!*/ ToS(RubyContext /*!*/ context, UnboundMethod /*!*/ self) { return(ToS(context, self.Name, self._info.DeclaringModule, self._targetConstraint, "UnboundMethod")); }
public static RubyArray GetSourceLocation(UnboundMethod/*!*/ self) { return GetSourceLocation(self.Info); }
public static MutableString/*!*/ ToS(UnboundMethod/*!*/ self) { return ToS(self.Name, self._info.DeclaringModule, self._targetConstraint, "UnboundMethod"); }
public static MutableString ToS(RubyContext/*!*/ context, UnboundMethod/*!*/ self) { return ToS(context, self.Name, self._info.DeclaringModule, self._targetConstraint, "UnboundMethod"); }
public static UnboundMethod BingGenericParameters(RubyContext/*!*/ context, UnboundMethod/*!*/ self, [NotNullItems]params object/*!*/[]/*!*/ typeArgs) { return new UnboundMethod(self.TargetConstraint, self.Name, MethodOps.BindGenericParameters(context, self.Info, self.Name, typeArgs)); }
public static UnboundMethod /*!*/ DefineMethod(RubyScope /*!*/ scope, RubyModule /*!*/ self, [DefaultProtocol, NotNull] string /*!*/ methodName, [NotNull] UnboundMethod /*!*/ method) { DefineMethod(scope, self, methodName, method.Info, method.TargetConstraint); return(method); }
public static UnboundMethod Clone(UnboundMethod/*!*/ self) { return new UnboundMethod(self._targetConstraint, self._name, self._info); }
public static UnboundMethod /*!*/ DefineMethod(RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ methodName, [NotNull] UnboundMethod /*!*/ method) { // MRI 1.8 does the check when the method is called, 1.9 checks it upfront as we do: if (!self.HasAncestor(method.TargetConstraint)) { throw RubyExceptions.CreateTypeError( String.Format("bind argument must be a subclass of {0}", method.TargetConstraint.Name) ); } self.AddDefinedMethod(methodName, method.Info); return(method); }
public static UnboundMethod /*!*/ BingGenericParameters(RubyContext /*!*/ context, UnboundMethod /*!*/ self, [NotNullItems] params object /*!*/[] /*!*/ typeArgs) { return(new UnboundMethod(self.TargetConstraint, self.Name, MethodOps.BindGenericParameters(context, self.Info, self.Name, typeArgs))); }