Beispiel #1
0
            private void ObjectMonkeyPatch(RubyModule /*!*/ module)
            {
                Debug.Assert(module == Context.ObjectClass);

                DefineLibraryMethod(module, "object_monkey", 0x9, new[] {
                    LibraryOverload.Reflect(new Func <object, string>(MonkeyWorker)),
                });
            }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 private void LibModuleSingletonMethods(RubyModule /*!*/ module)
 {
     DefineLibraryMethod(module, "bar", (int)RubyMethodAttributes.PublicSingleton, new[] {
         LibraryOverload.Reflect(new Func <RubyModule, string>(Bar)),
     });
 }