@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name) { Object dgs = self.dataGetStruct(); if (dgs != null) { return ((JavaObject)dgs).java_class(); } else { return JavaClass.get(context.runtime, self.getClass()); } } });
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name) { Object dgs = self.dataGetStruct(); if (dgs != null) { return ((JavaObject)dgs).java_class(); } else { return JavaClass.get(context.runtime, self.getClass()); } } });
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg) { // TODO: WRONG - get interfaces from class if (arg.respondsTo("java_object")) { IRubyObject interfaces = self.getMetaClass().getInstanceVariables().getInstanceVariable("@java_interfaces"); assert interfaces instanceof RubyArray : "interface list was not an array"; return context.runtime.newBoolean(((RubyArray) interfaces).op_diff( ((JavaClass) ((JavaObject) arg.dataGetStruct()).java_class()).interfaces()).equals(RubyArray.newArray(context.runtime))); } else { return Helpers.invoke(context, self, "old_eqq", arg); } } });
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg) { // TODO: WRONG - get interfaces from class if (arg.respondsTo("java_object")) { IRubyObject interfaces = self.getMetaClass().getInstanceVariables().getInstanceVariable("@java_interfaces"); assert interfaces instanceof RubyArray : "interface list was not an array"; return context.runtime.newBoolean(((RubyArray) interfaces).op_diff( ((JavaClass) ((JavaObject) arg.dataGetStruct()).java_class()).interfaces()).equals(RubyArray.newArray(context.runtime))); } else { return Helpers.invoke(context, self, "old_eqq", arg); } } });