<p>When using something like <code>object.methods.sort.to_yaml</code> I'd like to have irb interpret the \n characters rather than print them. </p>

<p>I currently get the following output:</p>

<pre><code>--- \n- "&amp;"\n- "*"\n- +\n- "-"\n- "&lt;&lt;"\n- &lt;=&gt;\n ...
</code></pre>

<p>What I'd like is something similar to this:</p>

<pre><code>--- 
 - "&amp;"
 - "*"
 - +
 - "-"
 - "&lt;&lt;"
 - &lt;=&gt;
</code></pre>

<p>Is this possible? Is there another method I can be calling which will interpret the string perhaps?</p>

That's just irb -- I don't think you can control the
```
return
```
formatting.
You can still use
```
print
```
or
```
puts
```
to display it as you want.