inspect -> String
オブジェクトを人間が読める形式に変換
した文字列を返します。
組み込み関数 Kernel.#p は、このメソッドの結果を使用してオブジェクトを表示します。
irb(main):004> [ 1, 2, 3..4, 'five' ].inspect
=> "[1, 2, 3..4, \"five\"]"
irb(main):005> "fafa".inspect
=> "\"fafa\""
irb(main):006> :fafa.inspect
=> ":fafa"
irb(main):007> ["fafa","fafa","fafa"].map!(&:inspect)
=> ["\"fafa\"", "\"fafa\"", "\"fafa\""]
irb(main):008> p ["fafa","fafa","fafa"].map!(&:inspect)
["\"fafa\"", "\"fafa\"", "\"fafa\""]
=> ["\"fafa\"", "\"fafa\"", "\"fafa\""]
irb(main):009> puts ["fafa","fafa","fafa"].map!(&:inspect)
"fafa"
"fafa"
"fafa"
=> nil
...
irb(main):011> p ["fafa","fafa","fafa"]
["fafa", "fafa", "fafa"]
=> ["fafa", "fafa", "fafa"]
irb(main):012> puts ["fafa","fafa","fafa"]
fafa
fafa
fafa