From: "Ara.T.Howard" Date: 2004-02-13T01:05:01+09:00 Subject: pp equiv of #inspect i often use raise SomeError, "object was <#{ object.inspect }>" and similar what would be the eqiv methods using pretty_print? i would like to do something like raise SomeError, "object was <#{ object.pretty_print_inspect }>" but that obviously does not work. what i am after is a method on object, or that takes an object, which returns as a string the output that pp(object) would have produced. i know i can do PP.pp(obj, port) but am looking for something shorter... -a -- ATTN: please update your address books with address below! =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328 | STP :: http://www.ngdc.noaa.gov/stp/ | NGDC :: http://www.ngdc.noaa.gov/ | NESDIS :: http://www.nesdis.noaa.gov/ | NOAA :: http://www.noaa.gov/ | US DOC :: http://www.commerce.gov/ | | The difference between art and science is that science is what we | understand well enough to explain to a computer. | Art is everything else. | -- Donald Knuth, "Discover" | | /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done' ===============================================================================