Examples of callMethod()


Examples of org.jruby.RubyClass.callMethod()

            }
            struct_type = RubyStruct.newInstance(runtime.fastGetModule("Struct"),params,Block.NULL_BLOCK);
        } else {
            struct_type = (RubyClass)sClass;
        }
        IRubyObject st = struct_type.callMethod(runtime.getCurrentContext(),"new");
        RubyArray members = RubyStruct.members(struct_type,Block.NULL_BLOCK);
        for(int i=0,j=members.size();i<j;i++) {
            IRubyObject m = members.eltInternal(i);
            st.callMethod(runtime.getCurrentContext(), m.toString() + "=", (IRubyObject)val.get(m));
        }
View Full Code Here

Examples of org.jruby.RubyException.callMethod()

            eval("exit " + argument);
            fail("Expected a SystemExit to be thrown by calling exit.");
        } catch (RaiseException re) {
          RubyException raisedException = re.getException();
          if (runtime.getClass("SystemExit").isInstance(raisedException)) {
              IRubyObject status = raisedException.callMethod(runtime.getCurrentContext(), "status");
              assertEquals(expectedStatus, status);
          } else {
            throw re;
          }
        }
View Full Code Here

Examples of org.jruby.RubyHash.callMethod()

                if (res == null) {
                    p--;
                    { p += 1; _goto_targ = 5; if (truecontinue _goto;}
                } else {
                    if (!parser.objectClass.getName().equals("Hash")) {
                        result.callMethod(context, "[]=", new IRubyObject[] { lastName, res.result });
                    } else {
                        result.op_aset(context, lastName, res.result);
                    }
                    {p = (( res.p))-1;}
                }
View Full Code Here

Examples of org.jruby.RubyModule.callMethod()

        RubyModule module = context.getRubyClass();
  
        if (module == null) throw runtime.newTypeError("no class to make alias");
  
        module.defineAlias(newName, oldName);
        module.callMethod(context, "method_added", runtime.newSymbol(newName));
  
        return runtime.getNil();
    }
   
    public static IRubyObject negate(IRubyObject value, Ruby runtime) {
View Full Code Here

Examples of org.jruby.RubyModule.callMethod()

  
        if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
            containingClass.getSingletonClass().addMethod(name,
                    new WrapperMethod(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC));
           
            containingClass.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(name));
        }
  
        // 'class << state.self' and 'class << obj' uses defn as opposed to defs
        if (containingClass.isSingleton()) {
            ((MetaClass) containingClass).getAttached().callMethod(context,
View Full Code Here

Examples of org.jruby.RubyModule.callMethod()

        // 'class << state.self' and 'class << obj' uses defn as opposed to defs
        if (containingClass.isSingleton()) {
            ((MetaClass) containingClass).getAttached().callMethod(context,
                    "singleton_method_added", runtime.fastNewSymbol(name));
        } else {
            containingClass.callMethod(context, "method_added", runtime.fastNewSymbol(name));
        }
  
        return runtime.getNil();       
    }
}
View Full Code Here

Examples of org.jruby.RubyModule.callMethod()

                }

                rubyObj = unmarshalObject();
               
                tp.extend_object(rubyObj);
                tp.callMethod(runtime.getCurrentContext(),"extended", rubyObj);
                break;
            case 'l' :
                rubyObj = RubyBignum.unmarshalFrom(this);
                break;
            case 'S' :
View Full Code Here

Examples of org.jruby.RubyModule.callMethod()

        RubyString data = RubyString.newString(getRuntime(), marshaled);
        if (ivarsWaiting) {
            defaultVariablesUnmarshal(data);
            ivarsWaiting = false;
        }
        IRubyObject result = classInstance.callMethod(getRuntime().getCurrentContext(),
            "_load", data);
        registerLinkTarget(result);
        return result;
    }
View Full Code Here

Examples of org.jruby.RubyObject.callMethod()

    @JRubyMethod(name = "new", rest = true, frame = true, meta = true)
    public static IRubyObject new_instance(IRubyObject self, IRubyObject[] args, Block block) {
        // Generator#new
        IRubyObject result = new RubyObject(self.getRuntime(),(RubyClass)self);
        result.dataWrapStruct(new GeneratorData(result));
        result.callMethod(self.getRuntime().getCurrentContext(), "initialize", args, block);
        return result;
    }

    @JRubyMethod(optional = 1, frame = true, visibility = Visibility.PRIVATE)
    public static IRubyObject initialize(IRubyObject self, IRubyObject[] args, Block block) {
View Full Code Here

Examples of org.jruby.RubyObjectAdapter.callMethod()

        return result;
    }

    protected Map<Object, Object> getQueryParameter(IRubyObject connection_uri) {
        final RubyObjectAdapter api = JavaEmbedUtils.newObjectAdapter();
        final IRubyObject query_values = api.callMethod(connection_uri, "query");

        if (query_values.isNil()) {
            return null;
        } else {
            return query_values.convertToHash();
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.