@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject name) { RubyClass klass = self.getMetaClass(); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = name.asJavaString(); if (strName.equals(tuple.name) && tuple.checkVisibility) return tuple.respondsTo; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, name); }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject name) { RubyClass klass = self.getMetaClass(); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = name.asJavaString(); if (strName.equals(tuple.name) && tuple.checkVisibility) return tuple.respondsTo; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, name); }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject name, IRubyObject bool) { RubyClass klass = getMetaClass(self); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = name.asJavaString(); if (strName.equals(tuple.name) && !bool.isTrue() == tuple.checkVisibility) return tuple.respondsTo; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, name, bool); }
private static RespondToTuple recacheRespondsTo(CacheEntry respondToMethod, String newString, RubyClass klass, boolean checkVisibility, ThreadContext context) { Ruby runtime = context.runtime; CacheEntry respondToLookupResult = klass.searchWithCache(newString); IRubyObject respondsTo; if (!respondToLookupResult.method.isUndefined() && !respondToLookupResult.method.isNotImplemented()) { respondsTo = checkVisibilityAndCache(respondToLookupResult, checkVisibility, runtime); } else { respondsTo = runtime.getFalse(); } return new RespondToTuple(newString, checkVisibility, respondToMethod, respondToLookupResult, respondsTo); }
private static RespondToTuple recacheRespondsTo(CacheEntry respondToMethod, String newString, RubyClass klass, boolean checkVisibility, ThreadContext context) { Ruby runtime = context.runtime; CacheEntry respondToLookupResult = klass.searchWithCache(newString); IRubyObject respondsTo; if (!respondToLookupResult.method.isUndefined() && !respondToLookupResult.method.isNotImplemented()) { respondsTo = checkVisibilityAndCache(respondToLookupResult, checkVisibility, runtime); } else { respondsTo = runtime.getFalse(); } return new RespondToTuple(newString, checkVisibility, respondToMethod, respondToLookupResult, respondsTo); }
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) { 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(); }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject name, IRubyObject bool) { RubyClass klass = self.getMetaClass(); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = name.asJavaString(); if (strName.equals(tuple.name) && !bool.isTrue() == tuple.checkVisibility) return tuple.respondsTo; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, name, bool); }
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(); }
private static RespondToTuple recacheRespondsTo(CacheEntry respondToMethod, String newString, RubyClass klass, boolean checkVisibility, ThreadContext context) { CacheEntry respondToLookupResult = klass.searchWithCache(newString); boolean respondsTo = Helpers.respondsToMethod(respondToLookupResult.method, checkVisibility); return new RespondToTuple(newString, checkVisibility, respondToMethod, respondToLookupResult, context.runtime.newBoolean(respondsTo)); } }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject name) { RubyClass klass = getMetaClass(self); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = name.asJavaString(); if (strName.equals(tuple.name) && tuple.checkVisibility) return tuple.respondsTo; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, name); }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject name, IRubyObject bool) { RubyClass klass = getMetaClass(self); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = name.asJavaString(); if (strName.equals(tuple.name) && !bool.isTrue() == tuple.checkVisibility) return tuple.respondsTo; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, name, bool); }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject name) { RubyClass klass = getMetaClass(self); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = name.asJavaString(); if (strName.equals(tuple.name) && tuple.checkVisibility) return tuple.respondsTo; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, name); }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject name, IRubyObject bool) { RubyClass klass = self.getMetaClass(); RespondToTuple tuple = respondToTuple; if (tuple.cacheOk(klass)) { String strName = name.asJavaString(); if (strName.equals(tuple.name) && !bool.isTrue() == tuple.checkVisibility) return tuple.respondsTo; } // go through normal call logic, which will hit overridden cacheAndCall return super.call(context, caller, self, name, bool); }
private static RespondToTuple recacheRespondsTo(CacheEntry respondToMethod, String newString, RubyClass klass, boolean checkVisibility, ThreadContext context) { CacheEntry respondToLookupResult = klass.searchWithCache(newString); boolean respondsTo = Helpers.respondsToMethod(respondToLookupResult.method, checkVisibility); return new RespondToTuple(newString, checkVisibility, respondToMethod, respondToLookupResult, context.runtime.newBoolean(respondsTo)); } }
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(); }