Ruby provides two string conversion methods, `to_s` and `to_str`, that serve fundamentally different purposes. `to_s` is defined on virtually all objects and returns a string representation for display purposes — it's an explicit conversion. `to_str`, by contrast, is an implicit conversion that signals the object behaves like a
Table of contents
Difference In Scope Of DefinitionDifference In BehaviorNote On Implicit / Explicit ConversionSumming It UpSort: