I have a hash:
hash = { test: 'Test' }
If I am in an irb session and I enter hash, it outputs the content of the hash:
{
:test => 'Test'
}
What method is being invoked on the variable hash when I do that?
The method is Hash#inspect.
hash = { test: 'Test' }
# => {:test=>"Test"}
hash.inspect
# => "{:test=>\"Test\"}"