public static RubyModule/*!*/ InitializeCopy(RubyModule/*!*/ self, object other) { // no class can be reinitialized: if (self.IsClass) { throw RubyExceptions.CreateTypeError("already initialized class"); } // self could be a meta-module: RubyClass selfClass = self.Context.GetClassOf(self); RubyClass otherClass = self.Context.GetClassOf(other); if (otherClass != selfClass) { throw RubyExceptions.CreateTypeError("initialize_copy should take same class object"); } self.InitializeModuleCopy((RubyModule)other); return self; }
public static RubyModule /*!*/ InitializeCopy(RubyModule /*!*/ self, object other) { // no class can be reinitialized: if (self.IsClass) { throw RubyExceptions.CreateTypeError("already initialized class"); } // self could be a meta-module: RubyClass selfClass = self.Context.GetClassOf(self); RubyClass otherClass = self.Context.GetClassOf(other); if (otherClass != selfClass) { throw RubyExceptions.CreateTypeError("initialize_copy should take same class object"); } self.InitializeModuleCopy((RubyModule)other); return(self); }