@JRubyMethod public IRubyObject inspect() { StringBuilder result = new StringBuilder(); result.append(nameOnInspection()); result.append("("); Class[] parameterTypes = getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { result.append(parameterTypes[i].getName()); if (i < parameterTypes.length - 1) { result.append(','); } } result.append(")>"); return getRuntime().newString(result.toString()); }
@JRubyMethod public IRubyObject inspect() { StringBuilder result = new StringBuilder(); result.append(nameOnInspection()); result.append("("); Class[] parameterTypes = getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { result.append(parameterTypes[i].getName()); if (i < parameterTypes.length - 1) { result.append(','); } } result.append(")>"); return getRuntime().newString(result.toString()); }
@Override @JRubyMethod public RubyString inspect() { StringBuilder str = new StringBuilder(); str.append("#<"); str.append( getDeclaringClass().nameOnInspection() ).append('/').append( getName() ); inspectParameterTypes(str, this); str.append('>'); return RubyString.newString(getRuntime(), str); }
@JRubyMethod(name = "invoke", rest = true) public IRubyObject do_invoke(IRubyObject[] nargs) { if (nargs.length != 1 + getArity()) { throw getRuntime().newArgumentError(nargs.length, 1 + getArity()); throw getRuntime().newTypeError("invokee not a java object"); return JavaUtil.convertJavaToRuby(getRuntime(), javaResult, getReturnType()); } catch (IllegalArgumentException e) { throw getRuntime().newTypeError("expected " + argument_types().inspect()); } catch (IllegalAccessException iae) { throw getRuntime().newTypeError("illegal access on '" + sm.getName() + "': " + iae.getMessage()); } catch (InvocationTargetException ite) { if (getRuntime().getDebug().isTrue()) ite.getTargetException().printStackTrace(); getRuntime().getJavaSupport().handleNativeException(ite.getTargetException(), sm); return getRuntime().getNil();
@JRubyMethod(name = "invoke", rest = true) public IRubyObject do_invoke(IRubyObject[] nargs) { if (nargs.length != 1 + getArity()) { throw getRuntime().newArgumentError(nargs.length, 1 + getArity()); throw getRuntime().newTypeError("invokee not a java object"); return JavaUtil.convertJavaToRuby(getRuntime(), javaResult, getReturnType()); } catch (IllegalArgumentException e) { throw getRuntime().newTypeError("expected " + argument_types().inspect()); } catch (IllegalAccessException iae) { throw getRuntime().newTypeError("illegal access on '" + sm.getName() + "': " + iae.getMessage()); } catch (InvocationTargetException ite) { if (getRuntime().getDebug().isTrue()) ite.getTargetException().printStackTrace(); getRuntime().getJavaSupport().handleNativeException(ite.getTargetException(), sm); return getRuntime().getNil();
@JRubyMethod(name = "invoke", rest = true) public IRubyObject do_invoke(final IRubyObject[] args) { final Ruby runtime= getRuntime(); if ( args.length != 1 + getArity() ) { throw runtime.newArgumentError(args.length, 1 + getArity());
@JRubyMethod(name = "invoke", rest = true) public IRubyObject do_invoke(final IRubyObject[] args) { final Ruby runtime= getRuntime(); if ( args.length != 1 + getArity() ) { throw runtime.newArgumentError(args.length, 1 + getArity());
public RubyObject name() { return getRuntime().newString(getName()); }
public RubyObject name() { return getRuntime().newString(getName()); }
@JRubyMethod public RubyFixnum arity() { return getRuntime().newFixnum(getArity()); }
@JRubyMethod public RubyFixnum arity() { return getRuntime().newFixnum(getArity()); }
@JRubyMethod(name = "super?") public IRubyObject super_p() { return hasSuperImplementation() ? getRuntime().getTrue() : getRuntime().getFalse(); }
public RubyObject name() { return getRuntime().newString(getName()); }
@JRubyMethod(name = "super?") public IRubyObject super_p() { return hasSuperImplementation() ? getRuntime().getTrue() : getRuntime().getFalse(); }
public RubyObject name() { return getRuntime().newString(getName()); }
@JRubyMethod(name = "super?") public IRubyObject super_p() { return hasSuperImplementation() ? getRuntime().getTrue() : getRuntime().getFalse(); }
@JRubyMethod public RubyFixnum arity() { return getRuntime().newFixnum(getArity()); }
@JRubyMethod public RubyFixnum arity() { return getRuntime().newFixnum(getArity()); }
@JRubyMethod(name = "super?") public IRubyObject super_p() { return hasSuperImplementation() ? getRuntime().getTrue() : getRuntime().getFalse(); }
@Override @JRubyMethod public RubyString inspect() { StringBuilder str = new StringBuilder(); str.append("#<"); str.append( getDeclaringClass().nameOnInspection() ).append('/').append( getName() ); inspectParameterTypes(str, this); str.append('>'); return RubyString.newString(getRuntime(), str); }