Package org.jruby

Examples of org.jruby.RubyArray.entry()


        for (int i = 0; i < parameterTypes.length; ++i) {
            IRubyObject type = paramTypes.entry(i);
            if (!(type instanceof Type)) {
                throw context.runtime.newArgumentError("Invalid parameter type");
            }
            parameterTypes[i] = (Type) paramTypes.entry(i);
        }
        MemoryIO fptr = ptr.getMemoryIO();
        return new JFFIInvoker(context.runtime, (RubyClass) recv, fptr,
                (Type) returnType, parameterTypes,
                "stdcall".equals(convention) ? CallingConvention.STDCALL : CallingConvention.DEFAULT,
View Full Code Here


        Map<RubySymbol, RubyInteger> s2v = new IdentityHashMap<RubySymbol, RubyInteger>();
        IRubyObject prevConstant = null;
        int nextValue = 0;

        for (int i = 0; i < ary.size(); i++) {
            IRubyObject v = ary.entry(i);

            if (v instanceof RubySymbol) {
                s2v.put((RubySymbol) v, RubyFixnum.newFixnum(context.runtime, nextValue));
                prevConstant = v;
                nextValue++;
View Full Code Here

                RubyModule pathHelper = runtime.getClassFromPath("JRuby::PathHelper");
                RubyArray parts = (RubyArray) Helpers.invoke(
                        context, pathHelper, "smart_split_command", rawArgs);
                args = new String[parts.getLength()];
                for (int i = 0; i < parts.getLength(); i++) {
                    args[i] = parts.entry(i).toString();
                }
            }
        } else {
            args = new String[rawArgs.length];
            int start = 0;
View Full Code Here

                            };

                            indexes.append( indexDefinition.callMethod(context, "new", args) ); // IndexDefinition.new
                        }

                        IRubyObject lastIndexDef = indexes.isEmpty() ? null : indexes.entry(-1);
                        if ( lastIndexDef != null ) {
                            final String columnName = caseConvertIdentifierForRails(connection, keySet.getString("column_name"));
                            final int length = keySet.getInt("sub_part");
                            final boolean nullLength = keySet.wasNull();
View Full Code Here

        children = XmlNodeSet.newXmlNodeSet(context, allDecls);

        // add attribute decls as attributes to the matching element decl
        RubyArray keys = attributes.keys();
        for (int i = 0; i < keys.getLength(); ++i) {
            IRubyObject akey = keys.entry(i);
            IRubyObject val;

            val = attributes.op_aref(context, akey);
            if (val.isNil()) continue;
            XmlAttributeDecl attrDecl = (XmlAttributeDecl) val;
View Full Code Here

        }

        // add content models to the matching element decl
        keys = contentModels.keys();
        for (int i = 0; i < keys.getLength(); ++i) {
            IRubyObject key = keys.entry(i);
            IRubyObject cm = contentModels.op_aref(context, key);

            IRubyObject elem = elements.op_aref(context, key);
            if (elem.isNil()) continue;
            if (((XmlElementDecl)elem).isEmpty()) continue;
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.