private void checkCallableArity(final T callable, final int expected) { final int arity = callable.getArity(); if ( arity != expected ) throw runtime.newArgumentError(expected, arity); }
private void checkCallableArity(final T callable, final int expected) { final int arity = callable.getArity(); if ( arity != expected ) throw runtime.newArgumentError(expected, arity); }
@JRubyMethod public final RubyFixnum arity() { return getRuntime().newFixnum(getArity()); }
@JRubyMethod public final RubyFixnum arity() { return getRuntime().newFixnum(getArity()); }
@JRubyMethod public final RubyFixnum arity() { return getRuntime().newFixnum(getArity()); }
@JRubyMethod public final RubyFixnum arity() { return getRuntime().newFixnum(getArity()); }
if ( length == 1 ) { callable = createCallable(runtime, members[0]); maxArity = minArity = callable.getArity(); if ( callable.isVarArgs() ) { varargsCallables = createCallableArray(callable);
if ( length == 1 ) { callable = createCallable(runtime, members[0]); maxArity = minArity = callable.getArity(); if ( callable.isVarArgs() ) { varargsCallables = createCallableArray(callable);
@SuppressWarnings("unchecked") // NULL_CACHE RubyToJavaInvoker(RubyModule host, Member member, String name) { super(host, Visibility.PUBLIC, name); this.runtime = host.getRuntime(); final T callable; T[] varargsCallables = null; int minVarArgsArity = -1; callable = createCallable(runtime, member); int minArity = callable.getArity(); if ( callable.isVarArgs() ) { // TODO does it need to happen? varargsCallables = createCallableArray(callable); minVarArgsArity = getMemberArity(member) - 1; } cache = NULL_CACHE; // if there's a single callable - matching (and thus the cache) won't be used this.javaCallable = callable; this.javaCallables = null; this.javaVarargsCallables = varargsCallables; setArity(minArity, minArity, minVarArgsArity); setupNativeCall(); }
@SuppressWarnings("unchecked") // NULL_CACHE RubyToJavaInvoker(RubyModule host, Member member, String name) { super(host, Visibility.PUBLIC, name); this.runtime = host.getRuntime(); final T callable; T[] varargsCallables = null; int minVarArgsArity = -1; callable = createCallable(runtime, member); int minArity = callable.getArity(); if ( callable.isVarArgs() ) { // TODO does it need to happen? varargsCallables = createCallableArray(callable); minVarArgsArity = getMemberArity(member) - 1; } cache = NULL_CACHE; // if there's a single callable - matching (and thus the cache) won't be used this.javaCallable = callable; this.javaCallables = null; this.javaVarargsCallables = varargsCallables; setArity(minArity, minArity, minVarArgsArity); setupNativeCall(); }