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.

"itsme213" <itsme213 / hotmail.com> wrote in message
news:8BOqd.59658$g21.3667 / fe1.texas.rr.com...
> Where would I find a nice summary of to_s, inspect, p, etc. and the core
> ones to override for various purposes?
>
> Are to_s, inspect, etc. defined more-or-less consistently for the library
> classes? Are they used consistently by the various tools like irb, debug,
> test/unit, breakpoint, etc?
>
> I often find myself with quite unhelpful presentations of objects e.g.
when
> a test/unit assertion fails, I might get a 2-page long description of one
of
> the objects involved. For my own classes I poke around at to_s and friends
> but it often feels like guesswork.
>
> Thanks!
>
>