Gavin Sinclair
11/25/2004 12:59:00 PM
On Thursday, November 25, 2004, 10:37:16 PM, Hal wrote:
> There are three things I would like to do but I am not
> sure how:
> 2. Retrieve the text without printing it (analogous to #inspect):
> str = obj.pretty # or whatever
require 'extensions/object'
str = obj.pp_s
> 1. Redirect the output to another IO -- something like
> STDERR.pp obj
STDERR.puts obj.pp_s
Cheers,
Gavin
P.S. It seems to me that all the questions you're asking should be
more elegantly solved by the 'pp' library. That it, it should all
"just work".