private void ObjectMonkeyPatch(RubyModule /*!*/ module) { Debug.Assert(module == Context.ObjectClass); DefineLibraryMethod(module, "object_monkey", 0x9, new[] { LibraryOverload.Reflect(new Func <object, string>(MonkeyWorker)), }); }
protected override void LoadModules() { DefineGlobalModule("Tests", typeof(DefaultProtocolTester), (int)ModuleRestrictions.NoUnderlyingType, null, (module) => { DefineLibraryMethod(module, "to_int_to_str", (int)RubyMethodAttributes.PublicSingleton, new[] { LibraryOverload.Reflect(new Func <RubyModule, Union <int, MutableString>, RubyArray>(ToIntToStr)), }); DefineLibraryMethod(module, "to_str_to_int", (int)RubyMethodAttributes.PublicSingleton, new[] { LibraryOverload.Reflect(new Func <RubyModule, Union <MutableString, int>, RubyArray>(ToStrToInt)), }); }, null, RubyModule.EmptyArray); }
private void LibModuleSingletonMethods(RubyModule /*!*/ module) { DefineLibraryMethod(module, "bar", (int)RubyMethodAttributes.PublicSingleton, new[] { LibraryOverload.Reflect(new Func <RubyModule, string>(Bar)), }); }