Why do this Ruby object have two to_s and inspect methods that do the same thing? Or, so it seems
They are usually but not always the same. According to the documentation for
If not overridden, uses the to_s method to generate the string.
So by default, they return the same thing because
to_s(). Sometimes, however, it makes sense to override
to_s() to do one thing, but when inspecting an object from irb, you want to see more details. So they can be set up to do different things.