public static RubyModule /*!*/ RemoveMethod(RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ methodName) { if (!self.RemoveMethod(methodName)) { throw RubyExceptions.CreateUndefinedMethodError(self, methodName); } return(self); }
public static RubyModule /*!*/ RemoveMethod(RubyModule /*!*/ self, [DefaultProtocol, NotNullItems] params string[] /*!*/ methodNames) { foreach (var methodName in methodNames) { // MRI: reports a warning and allows removal if (self.IsBasicObjectClass && methodName == Symbols.Initialize) { throw RubyExceptions.CreateNameError("Cannot remove BasicObject#initialize"); } if (!self.RemoveMethod(methodName)) { throw RubyExceptions.CreateUndefinedMethodError(self, methodName); } } return(self); }
public static RubyModule/*!*/ RemoveMethod(RubyModule/*!*/ self, [DefaultProtocol]string/*!*/ methodName) { if (!self.RemoveMethod(methodName)) { throw RubyExceptions.CreateUndefinedMethodError(self, methodName); } return self; }
public static RubyModule/*!*/ RemoveMethod(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) { // MRI 1.8: reports a warning and allows removal // MRI 1.9: throws a NameError if (self == self.Context.ObjectClass && methodName == Symbols.Initialize) { throw RubyExceptions.CreateNameError("Cannot remove Object#initialize"); } if (!self.RemoveMethod(methodName)) { throw RubyExceptions.CreateUndefinedMethodError(self, methodName); } return self; }
public static RubyModule/*!*/ RemoveMethod(RubyModule/*!*/ self, [DefaultProtocol, NotNullItems]params string[]/*!*/ methodNames) { foreach (var methodName in methodNames) { // MRI: reports a warning and allows removal if (self.IsBasicObjectClass && methodName == Symbols.Initialize) { throw RubyExceptions.CreateNameError("Cannot remove BasicObject#initialize"); } if (!self.RemoveMethod(methodName)) { throw RubyExceptions.CreateUndefinedMethodError(self, methodName); } } return self; }