plugins/ruby/ruby-autogen-defs.rb
# avoid infinite recursion on mutually-referenced objects
avoid infinite recursion on mutually-referenced objects
avoid infinite recursion on mutually - referenced objects
def inspect
                cn = self.class.name.sub(/^DFHack::/, '')
                out = "#<#{cn}"
                return out << ' ...>' if @@inspecting[_memaddr]
                @@inspecting[_memaddr] = true
                _fields_ancestors.each { |n, o, s|
                    out << ' ' if out.length != 0 and out[-1, 1] != ' '
                    if out.length > INSPECT_SIZE_LIMIT
                        out << '...'
                        break
                    end
                    out << inspect_field(n, o, s)
                }
                out.chomp!(' ')
                @@inspecting.delete _memaddr
                out << '>'
            end
def inspect cn = self . class . name . sub ( / ^DFHack:: / , '' ) out = "#<#{cn}" return out << ' ...>' if @@inspecting [ _memaddr ] @@inspecting [ _memaddr ] = true _fields_ancestors . each { | n , o , s | out << ' ' if out . length != 0 and out [ - 1 , 1 ] != ' ' if out . length > INSPECT_SIZE_LIMIT out << '...' break end out << inspect_field ( n , o , s ) } out . chomp! ( ' ' ) @@inspecting . delete _memaddr out << '>' end
avoid infinite recursion on mutually-referenced objects
avoid infinite recursion on mutually - referenced objects