Package org.jruby

Examples of org.jruby.RubyModule.defineAnnotatedMethods()


* Converts data from one FFI type to another.
*/
public class DataConverter {
    public static RubyModule createDataConverterModule(Ruby runtime, RubyModule module) {
        RubyModule result = module.defineModuleUnder("DataConverter");
        result.defineAnnotatedMethods(DataConverter.class);
        result.defineAnnotatedConstants(DataConverter.class);

        return result;
    }

View Full Code Here


        module.defineConstant("LIBPREFIX", runtime.newString(LIBPREFIX));
        module.defineConstant("LIBSUFFIX", runtime.newString(LIBSUFFIX));
        module.defineConstant("BYTE_ORDER", runtime.newFixnum(BYTE_ORDER));
        module.defineConstant("BIG_ENDIAN", runtime.newFixnum(BIG_ENDIAN));
        module.defineConstant("LITTLE_ENDIAN", runtime.newFixnum(LITTLE_ENDIAN));
        module.defineAnnotatedMethods(Platform.class);
    }
    @JRubyMethod(name = "windows?", module=true)
    public static IRubyObject windows_p(ThreadContext context, IRubyObject recv) {
        return context.runtime.newBoolean(OS == OS.WINDOWS);
    }
View Full Code Here


public class SnappyExtService implements BasicLibraryService {
  public boolean basicLoad(final Ruby runtime) {
    RubyModule snappyModule = runtime.defineModule("Snappy");
    snappyModule.defineAnnotatedMethods(SnappyModule.class);
    return true;
  }
}
View Full Code Here

    @Override
    public boolean basicLoad(final Ruby ruby) throws IOException {
        RubyModule jr_jackson = ruby.defineModule("JrJackson");

        RubyModule jr_jackson_raw = ruby.defineModuleUnder("Raw", jr_jackson);
        jr_jackson_raw.defineAnnotatedMethods(JrJacksonRaw.class);

        RubyClass runtimeError = ruby.getRuntimeError();
        RubyClass parseError = jr_jackson.defineClassUnder("ParseError", runtimeError, runtimeError.getAllocator());
        return true;
    }
View Full Code Here

@org.jruby.anno.JRubyModule(name = "ArJdbc::SQLite3")
public class SQLite3Module {

    public static RubyModule load(final RubyModule arJdbc) {
        RubyModule sqlite3 = arJdbc.defineModuleUnder("SQLite3");
        sqlite3.defineAnnotatedMethods( SQLite3Module.class );
        return sqlite3;
    }

    public static RubyModule load(final Ruby runtime) {
        return load( arjdbc.ArJdbcModule.get(runtime) );
View Full Code Here

@org.jruby.anno.JRubyModule(name = "ArJdbc::DB2")
public class DB2Module {

    public static RubyModule load(final RubyModule arJdbc) {
        RubyModule db2 = arJdbc.defineModuleUnder("DB2");
        db2.defineAnnotatedMethods( DB2Module.class );
        return db2;
    }

    public static RubyModule load(final Ruby runtime) {
        return load( arjdbc.ArJdbcModule.get(runtime) );
View Full Code Here

@org.jruby.anno.JRubyModule(name = "ArJdbc::MSSQL")
public class MSSQLModule {

    public static RubyModule load(final RubyModule arJdbc) {
        RubyModule mssql = arJdbc.defineModuleUnder("MSSQL");
        mssql.defineAnnotatedMethods( MSSQLModule.class );
        return mssql;
    }

    public static RubyModule load(final Ruby runtime) {
        return load( arjdbc.ArJdbcModule.get(runtime) );
View Full Code Here

@org.jruby.anno.JRubyModule(name = "ArJdbc::PostgreSQL")
public class PostgreSQLModule {

    public static RubyModule load(final RubyModule arJdbc) {
        RubyModule postgreSQL = arJdbc.defineModuleUnder("PostgreSQL");
        postgreSQL.defineAnnotatedMethods( PostgreSQLModule.class );
        return postgreSQL;
    }

    public static RubyModule load(final Ruby runtime) {
        return load( arjdbc.ArJdbcModule.get(runtime) );
View Full Code Here

@JRubyModule(name = "ArJdbc")
public class ArJdbcModule {

    public static RubyModule load(final Ruby runtime) {
        final RubyModule arJdbc = runtime.getOrCreateModule("ArJdbc");
        arJdbc.defineAnnotatedMethods( ArJdbcModule.class );
        return arJdbc;
    }

    public static RubyModule get(final Ruby runtime) {
        return runtime.getModule("ArJdbc");
View Full Code Here

@org.jruby.anno.JRubyModule(name = "ArJdbc::HSQLDB")
public class HSQLDBModule {

    public static RubyModule load(final RubyModule arJdbc) {
        RubyModule hsqldb = arJdbc.defineModuleUnder("HSQLDB");
        hsqldb.defineAnnotatedMethods( HSQLDBModule.class );
        return hsqldb;
    }

    public static RubyModule load(final Ruby runtime) {
        return load( arjdbc.ArJdbcModule.get(runtime) );
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.