string_value = a.pretty_inspect
#pretty_inspect
also comes along when you first require ‘pp’ – See: http://ruby-doc.org/stdlib-2.1.0/libdoc/pp/rdoc/Kernel.html#method-i-pretty_inspect
If you want the version that is outputted to the irb
console that is
string_value = a.inspect
and doesn’t have any requires necessary.