From: Matthew Moss Date: 2008-12-11T12:29:03+09:00 Subject: Re: P shows object values, so can u put P and value in txt? On Dec 10, 2008, at 8:23 PM, Gregory Brown wrote: > On Wed, Dec 10, 2008 at 4:35 PM, Matthew Moss wrote: >> By 'ri p', it was meant that you do that on the command-line. >> (Actually, >> you'd want to type: 'ri Kernel#p') >> >> 'ri' provides documentation for Ruby classes/methods. >> >> If you run the command 'ri Kernel#p', you'll see that 'p' returns >> nil. So >> you can't use it directly to write to a file. Have you tried 'to_s'? > > If the OP wants string output from what he sees with Kernel#p, > Object#inspect should be used, not to_s Yes, that. :D