如何将变量打印到变量而不是STDOUT?

我想使用Ruby的pp来“打印”到变量而不是STDOUT。 怎么做的?

 require 'pp' result = PP.pp(some_variable, "")