Package org.jruby

Examples of org.jruby.RubyArray.shift()


    static List<Object> getList(ThreadContext context, IRubyObject value) {
        RubyArray ruby_array = (RubyArray)RuntimeHelpers.invoke(context, value, "to_a");
        List<Object> list = new ArrayList<Object>();
        while (true) {
            IRubyObject element = ruby_array.shift(context);
            if (element.isNil()) break;
            list.add(DiametricUtils.convertRubyToJava(context, element));
        }
        return Collections.unmodifiableList(list);
    }
View Full Code Here


    @JRubyMethod(visibility=Visibility.PRIVATE)
    public IRubyObject process_xincludes(ThreadContext context, IRubyObject options) {
        XmlDocument xmlDocument = (XmlDocument)document(context);
        RubyArray errors = (RubyArray)xmlDocument.getInstanceVariable("@errors");
        while(errors.getLength() > 0) {
            XmlSyntaxError error = (XmlSyntaxError)errors.shift(context);
            if (error.toString().contains("Include operation failed")) {
                throw new RaiseException(error);
            }
        }
        return this;
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.