The .inspect method of any object should format is correctly for display, just do..
<%= theobject.inspect %>
The .methods method may also be of use:
<%= theobject.methods.inspect %>
It may help to put that in <pre> tags, depending on the data