core/src/main/java/org/jruby/RubyBasicObject.java
private RubyString inspectObj(final Ruby runtime, RubyString part) {
        final ThreadContext context = runtime.getCurrentContext();

        boolean first = true;
        for (Map.Entry<String, VariableAccessor> entry : metaClass.getVariableTableManager().getVariableAccessorsForRead().entrySet()) {
            Object value = entry.getValue().get(this);
            if (!(value instanceof IRubyObject)) continue;
            RubySymbol symbol = runtime.newSymbol(entry.getKey());
            if (!symbol.validInstanceVariableName()) continue;

            IRubyObject obj = (IRubyObject) value;

            if (!first) encStrBufCat(runtime, part, COMMA);
            encStrBufCat(runtime, part, SPACE);
            // FIXME: bytelist_love: EPICLY wrong but something in MRI gets around identifiers of arbitrary encoding.
            encStrBufCat(runtime, part, symbol.asString().encode(context, runtime.getEncodingService().convertEncodingToRubyEncoding(part.getEncoding())).asString().getByteList());
            encStrBufCat(runtime, part, INSPECT_EQUALS);
            encStrBufCat(runtime, part, sites(context).inspect.call(context, obj, obj).convertToString().getByteList());

            first = false;
        }
        encStrBufCat(runtime, part, GT);
        part.setTaint(isTaint());
        return part;
    }
/** inspect_obj
     *
     * The internal helper method that takes care of the part of the
     * inspection that inspects instance variables.
     */
inspect_obj
The internal helper method that takes care of the part of the
inspection that inspects instance variables.
inspect_obj The internal helper method that takes care of the part of the inspection that inspects instance variables .
private RubyString inspectObj(final Ruby runtime, RubyString part) {
        final ThreadContext context = runtime.getCurrentContext();
        boolean first = true;
        for (Map.Entry<String, VariableAccessor> entry : metaClass.getVariableTableManager().getVariableAccessorsForRead().entrySet()) {
            Object value = entry.getValue().get(this);
            if (!(value instanceof IRubyObject)) continue;
            RubySymbol symbol = runtime.newSymbol(entry.getKey());
            if (!symbol.validInstanceVariableName()) continue;
            IRubyObject obj = (IRubyObject) value;
            if (!first) encStrBufCat(runtime, part, COMMA);
            encStrBufCat(runtime, part, SPACE);
            encStrBufCat(runtime, part, symbol.asString().encode(context, runtime.getEncodingService().convertEncodingToRubyEncoding(part.getEncoding())).asString().getByteList());
            encStrBufCat(runtime, part, INSPECT_EQUALS);
            encStrBufCat(runtime, part, sites(context).inspect.call(context, obj, obj).convertToString().getByteList());
            first = false;
        }
        encStrBufCat(runtime, part, GT);
        part.setTaint(isTaint());
        return part;
    }
private RubyString inspectObj ( final Ruby runtime , RubyString part ) { final ThreadContext context = runtime . getCurrentContext ( ) ; boolean first = true ; for ( Map . Entry < String , VariableAccessor > entry : metaClass . getVariableTableManager ( ) . getVariableAccessorsForRead ( ) . entrySet ( ) ) { Object value = entry . getValue ( ) . get ( this ) ; if ( ! ( value instanceof IRubyObject ) ) continue ; RubySymbol symbol = runtime . newSymbol ( entry . getKey ( ) ) ; if ( ! symbol . validInstanceVariableName ( ) ) continue ; IRubyObject obj = ( IRubyObject ) value ; if ( ! first ) encStrBufCat ( runtime , part , COMMA ) ; encStrBufCat ( runtime , part , SPACE ) ; encStrBufCat ( runtime , part , symbol . asString ( ) . encode ( context , runtime . getEncodingService ( ) . convertEncodingToRubyEncoding ( part . getEncoding ( ) ) ) . asString ( ) . getByteList ( ) ) ; encStrBufCat ( runtime , part , INSPECT_EQUALS ) ; encStrBufCat ( runtime , part , sites ( context ) . inspect . call ( context , obj , obj ) . convertToString ( ) . getByteList ( ) ) ; first = false ; } encStrBufCat ( runtime , part , GT ) ; part . setTaint ( isTaint ( ) ) ; return part ; }
inspect_obj
 The internal helper method that takes care of the part of the
 inspection that inspects instance variables.
inspect_obj The internal helper method that takes care of the part of the inspection that inspects instance variables .
// FIXME: bytelist_love: EPICLY wrong but something in MRI gets around identifiers of arbitrary encoding.