Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial1 Answer
Stone Preston
42,016 Pointsat 0:53 he states: Whenever we print something out to the screen using the puts method, internally Ruby is calling to string on it or to_s.
so you dont call the method yourself, ruby calls the to_s method you defined whenever you puts the class
Jory Braun
7,814 PointsJory Braun
7,814 PointsI zoned out when he said that, i realised right after my question.
Vamsi Pavan Mahesh Gunturu
4,541 PointsVamsi Pavan Mahesh Gunturu
4,541 PointsBut what about the argument passed in like in puts name, if we over ride to_s to print "bla". What will happen? name will be printed?