Examples of undefineMethod()


Examples of org.jruby.RubyClass.undefineMethod()

public class DelegateLibrary implements Library{
    public void load(Ruby runtime, boolean wrap) {
        RubyClass delegateClass = runtime.defineClass("Delegator", runtime.getObject(), runtime.getObject().getAllocator());
        delegateClass.defineAnnotatedMethods(Delegator.class);

        delegateClass.undefineMethod("==");
    }

    public static class Delegator {
        @JRubyMethod(visibility = Visibility.PRIVATE)
        public static IRubyObject initialize(ThreadContext context, IRubyObject self, IRubyObject obj) {
View Full Code Here

Examples of org.jruby.RubyClass.undefineMethod()

        mZlib.defineConstant("MAX_WBITS", runtime.newFixnum(JZlib.MAX_WBITS));

        // ZStream actually *isn't* allocatable
        RubyClass cZStream = mZlib.defineClassUnder("ZStream", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
        cZStream.defineAnnotatedMethods(ZStream.class);
        cZStream.undefineMethod("new");

        RubyClass cInflate = mZlib.defineClassUnder("Inflate", cZStream, JZlibInflate.INFLATE_ALLOCATOR);
        cInflate.defineAnnotatedMethods(JZlibInflate.class);

        RubyClass cDeflate = mZlib.defineClassUnder("Deflate", cZStream, JZlibDeflate.DEFLATE_ALLOCATOR);
View Full Code Here

Examples of org.jruby.RubyClass.undefineMethod()

public class DelegateLibrary implements Library{
    public void load(Ruby runtime, boolean wrap) {
        RubyClass delegateClass = runtime.defineClass("Delegator", runtime.getObject(), runtime.getObject().getAllocator());
        delegateClass.defineAnnotatedMethods(Delegator.class);

        delegateClass.undefineMethod("==");
    }
}
View Full Code Here

Examples of org.jruby.RubyClass.undefineMethod()

                "world_writable?", "writable_real?", "zero?");

        defineDelegateMethods(cPathname, runtime.getDir(), "mkdir", "rmdir");
        defineDelegateMethodsArrayOfPaths(cPathname, runtime.getDir(), "entries");

        cPathname.undefineMethod("=~");
    }

    static interface ReturnValueMapper {
        IRubyObject map(ThreadContext context, RubyClass klazz, IRubyObject value);
    }
View Full Code Here

Examples of org.jruby.RubyClass.undefineMethod()

        mZlib.defineConstant("MAX_WBITS", runtime.newFixnum(JZlib.MAX_WBITS));

        // ZStream actually *isn't* allocatable
        RubyClass cZStream = mZlib.defineClassUnder("ZStream", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
        cZStream.defineAnnotatedMethods(ZStream.class);
        cZStream.undefineMethod("new");

        RubyClass cInflate = mZlib.defineClassUnder("Inflate", cZStream, JZlibInflate.INFLATE_ALLOCATOR);
        cInflate.defineAnnotatedMethods(JZlibInflate.class);

        RubyClass cDeflate = mZlib.defineClassUnder("Deflate", cZStream, JZlibDeflate.DEFLATE_ALLOCATOR);
View Full Code Here

Examples of org.jruby.RubyClass.undefineMethod()

            public IRubyObject allocate(Ruby runtime, RubyClass klass) {
                return new ConditionVariable(runtime, klass);
            }
        });
        cConditionVariable.undefineMethod("initialize_copy");
        cConditionVariable.setReifiedClass(ConditionVariable.class);
        cConditionVariable.defineAnnotatedMethods(ConditionVariable.class);
    }

    @JRubyMethod(name = "wait", required = 1, optional = 1)
View Full Code Here

Examples of org.jruby.RubyClass.undefineMethod()

            public IRubyObject allocate(Ruby runtime, RubyClass klass) {
                return new Queue(runtime, klass);
            }
        });
        cQueue.undefineMethod("initialize_copy");
        cQueue.setReifiedClass(Queue.class);
        cQueue.defineAnnotatedMethods(Queue.class);
    }

    @JRubyMethod(visibility = Visibility.PRIVATE)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.