THE BOOK OF RUBY
As you will see, classes such as Class, Object, String and Treasure, simply return their names when the to_s method is called. An object, such as the Treasure object, t, returns its identifier – which is the same identifier returned by the inspect method: