Examples of IAutoloadMethod


Examples of org.jruby.runtime.load.IAutoloadMethod

    public static IRubyObject autoload_p(ThreadContext context, final IRubyObject recv, IRubyObject symbol) {
        Ruby runtime = context.getRuntime();
        RubyModule module = recv instanceof RubyModule ? (RubyModule) recv : runtime.getObject();
        String name = module.getName() + "::" + symbol.asJavaString();
       
        IAutoloadMethod autoloadMethod = runtime.getLoadService().autoloadFor(name);
        if (autoloadMethod == null) return runtime.getNil();

        return runtime.newString(autoloadMethod.file());
    }
View Full Code Here

Examples of org.jruby.runtime.load.IAutoloadMethod

        IRubyObject existingValue = module.fastFetchConstant(baseName);
        if (existingValue != null && existingValue != RubyObject.UNDEF) return runtime.getNil();
       
        module.fastStoreConstant(baseName, RubyObject.UNDEF);
       
        loadService.addAutoload(nm, new IAutoloadMethod() {
            public String file() {
                return file.toString();
            }
            /**
             * @see org.jruby.runtime.load.IAutoloadMethod#load(Ruby, String)
View Full Code Here

Examples of org.jruby.runtime.load.IAutoloadMethod

    public static IRubyObject autoload_p(ThreadContext context, final IRubyObject recv, IRubyObject symbol) {
        Ruby runtime = context.getRuntime();
        final RubyModule module = getModuleForAutoload(runtime, recv);
        String name = module.getName() + "::" + symbol.asJavaString();
       
        IAutoloadMethod autoloadMethod = runtime.getLoadService().autoloadFor(name);
        if (autoloadMethod == null) return runtime.getNil();

        return runtime.newString(autoloadMethod.file());
    }
View Full Code Here

Examples of org.jruby.runtime.load.IAutoloadMethod

        IRubyObject existingValue = module.fastFetchConstant(baseName);
        if (existingValue != null && existingValue != RubyObject.UNDEF) return runtime.getNil();

        module.fastStoreConstant(baseName, RubyObject.UNDEF);

        loadService.addAutoload(nm, new IAutoloadMethod() {
            public String file() {
                return file.toString();
            }
            /**
             * @see org.jruby.runtime.load.IAutoloadMethod#load(Ruby, String)
View Full Code Here

Examples of org.jruby.runtime.load.IAutoloadMethod

        final RubyModule module = getModuleForAutoload(runtime, recv);
       
        IRubyObject existingValue = module.fetchConstant(baseName);
        if (existingValue != null && existingValue != RubyObject.UNDEF) return runtime.getNil();

        module.defineAutoload(baseName, new IAutoloadMethod() {
            public String file() {
                return fileString.asJavaString();
            }

            public void load(Ruby runtime) {
View Full Code Here

Examples of org.jruby.runtime.load.IAutoloadMethod

        final RubyModule module = getModuleForAutoload(runtime, recv);
       
        IRubyObject existingValue = module.fetchConstant(baseName);
        if (existingValue != null && existingValue != RubyObject.UNDEF) return runtime.getNil();

        module.defineAutoload(baseName, new IAutoloadMethod() {
            @Override
            public String file() {
                return fileString.asJavaString();
            }
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.