Package org.jruby

Examples of org.jruby.RubyModule.defineMethod()


public class FastXsService implements BasicLibraryService {

    public boolean basicLoad(final Ruby runtime) throws IOException {
        RubyModule string = runtime.getModule("String");
        CallbackFactory fact = runtime.callbackFactory(FastXsService.class);
        string.defineMethod("fast_xs",fact.getFastSingletonMethod("fast_xs"));
        return true;
    }

    public static IRubyObject fast_xs(IRubyObject recv) {
        String string = recv.convertToString().getUnicodeValue();
View Full Code Here


public class FastXsService implements BasicLibraryService {

    public boolean basicLoad(final Ruby runtime) throws IOException {
        RubyModule string = runtime.getModule("String");
        CallbackFactory fact = runtime.callbackFactory(FastXsService.class);
        string.defineMethod("fast_xs",fact.getFastSingletonMethod("fast_xs"));
        return true;
    }

    public static IRubyObject fast_xs(IRubyObject recv) {
        String string = recv.convertToString().getUnicodeValue();
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.