On Thu, 2 Dec 2004 05:27:44 +0900 "itsme213" <itsme213 / hotmail.com> wrote: > It sounds from the discussion that we could benefit from a well thought out > (and/or well described!) framework for a set of print-related methods. I > know consistent use of these would help _me_ a lot. > > A naive (and incomplete and incorrect) example. Any resemblance to real Ruby > methods is purely accidental. > > - #short: a context-insensitive short string (no newlines) identifying the > object + class > - #probe: 1-level deep object structure + #short descriptions of 2nd level, > single line > - #probe n: N-level deep object structure > - #probe n Filter: N-level deep object structure only showing elements of > Filter > - #inspect: show full recursive object structure, ending at [String, Symbol, > Int, ...] > - #identify should show short string for object identification e.g. just a > 'name' attribute > - Object#short by default will print class name + #to_s > - #to_s should .... > - Object#inspect by default will .... > > Coming up with such a framework will take someone smarter than I. > Not exactly what you asked for, but you could try my attempt at an object browser http://ruby.brian-schroeder.de/quiz/object_browser/ that allows you to drill as deep into the object as you want. For debugging of complex structures it might be quite helpfull. (Beware of its alpha status) Regards, Brian -- Brian Schröäer http://www.brian-schroeder.de/