/** * Checks that this object is of type DATA and then returns it, otherwise raises failure (MRI: Check_Type(obj, T_DATA)) * * @param obj the object to check * @return the converted value */ public static final IRubyObject checkData(IRubyObject obj) { if(obj instanceof org.jruby.runtime.marshal.DataType) return obj; throw obj.getRuntime().newTypeError("wrong argument type " + typeAsString(obj) + " (expected Data)"); }
/** * Checks that this object is of type DATA and then returns it, otherwise raises failure (MRI: Check_Type(obj, T_DATA)) * * @param obj the object to check * @return the converted value */ public static final IRubyObject checkData(IRubyObject obj) { if(obj instanceof org.jruby.runtime.marshal.DataType) return obj; throw obj.getRuntime().newTypeError("wrong argument type " + typeAsString(obj) + " (expected Data)"); }
/** * Checks that this object is of type DATA and then returns it, otherwise raises failure (MRI: Check_Type(obj, T_DATA)) * * @param obj the object to check * @return the converted value */ public static IRubyObject checkData(IRubyObject obj) { if (obj instanceof org.jruby.runtime.marshal.DataType) return obj; Ruby runtime = obj.getRuntime(); throw runtime.newTypeError(str(runtime, "wrong argument type ", typeAsString(obj), " (expected Data)")); }
/** * Checks that this object is of type DATA and then returns it, otherwise raises failure (MRI: Check_Type(obj, T_DATA)) * * @param obj the object to check * @return the converted value */ public static IRubyObject checkData(IRubyObject obj) { if (obj instanceof org.jruby.runtime.marshal.DataType) return obj; Ruby runtime = obj.getRuntime(); throw runtime.newTypeError(str(runtime, "wrong argument type ", typeAsString(obj), " (expected Data)")); }
public static IRubyObject handleUncoercibleObject(Ruby runtime, IRubyObject obj, RubyClass target, boolean raise) { if (raise) throw runtime.newTypeError(str(runtime, "no implicit conversion of ", typeAsString(obj), " into " , target)); return runtime.getNil(); }
public static IRubyObject handleUncoercibleObject(Ruby runtime, IRubyObject obj, RubyClass target, boolean raise) { if (raise) throw runtime.newTypeError(str(runtime, "no implicit conversion of ", typeAsString(obj), " into " , target)); return runtime.getNil(); }
public static IRubyObject handleUncoercibleObject(boolean raise, IRubyObject obj, RubyClass target) throws RaiseException { if (raise) throw obj.getRuntime().newTypeError("can't convert " + typeAsString(obj) + " into " + target); return obj.getRuntime().getNil(); } }
public static IRubyObject handleUncoercibleObject(boolean raise, IRubyObject obj, RubyClass target) throws RaiseException { if (raise) throw obj.getRuntime().newTypeError("can't convert " + typeAsString(obj) + " into " + target); return obj.getRuntime().getNil(); } }