public boolean respondsTo(ThreadContext context, IRubyObject caller, IRubyObject self) { RubyClass klass = getMetaClass(self); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = respondToName; if (strName.equals(tuple.name) && tuple.checkVisibility) return tuple.respondsToBoolean; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, getRespondToNameSym(context)).isTrue(); }
public boolean respondsTo(ThreadContext context, IRubyObject caller, IRubyObject self) { RubyClass klass = getMetaClass(self); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = respondToName; if (strName.equals(tuple.name) && tuple.checkVisibility) return tuple.respondsToBoolean; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, getRespondToNameSym(context)).isTrue(); }
public boolean respondsTo(ThreadContext context, IRubyObject caller, IRubyObject self, boolean includePrivate) { RubyClass klass = getMetaClass(self); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = respondToName; if (strName.equals(tuple.name) && !includePrivate == tuple.checkVisibility) return tuple.respondsToBoolean; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, getRespondToNameSym(context), context.runtime.newBoolean(includePrivate)).isTrue(); }
public boolean respondsTo(ThreadContext context, IRubyObject caller, IRubyObject self, boolean includePrivate) { RubyClass klass = getMetaClass(self); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = respondToName; if (strName.equals(tuple.name) && !includePrivate == tuple.checkVisibility) return tuple.respondsToBoolean; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, getRespondToNameSym(context), context.runtime.newBoolean(includePrivate)).isTrue(); }