to_s VS to_str Jan 13, 2015 Today, one ofmy colleagues talked about to_s and to_str. He didn’t make it clear. Let me show you a simple example: class Integer def to_str 'it behaves like a string' end end puts '9' + 1 > 9it behaves like a string Please enable JavaScript to view the comments powered by Disqus.