Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, to_s returns the string representation of an object.

I think it's a safety measure in case the argument passed in is not a string, but can be turned into a string. Safe to assume that calling "to_s" on a string just returns the string.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: