From: Kevin Olbrich Date: 2006-01-06T21:44:21+09:00 Subject: Re: how remove puts inside method? Carlos Delmar wrote: >> I'm not really sure what you're up to. Can you elaborate? > > I'd like the output of process_transaction as a long string. But I don't > completely understand the post from Kevin: > >> output = "" >> ... >> output << line_of_file..... >> ... >> return output > > where does this go? > > If the method works I would like to apply it to each line of > transactions array and output the result to a new file. > > here's the latest version of the script: > http://rafb.net/paste/results/D632e199.html Just put this type of structure in whichever function you are trying to capture the output of. first line creates a string object, then you use the '<<' to append output to that string, then you do something with the string when you are done. -- Posted via http://www.ruby-forum.com/.