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 trial

Ruby Build an Address Book in Ruby Class Design Address Class: Part 1

Nicolas Filzi
Nicolas Filzi
18,021 Points

Why does Jason use interpolation on city, state and postal_code variables and not on street_1 and street_2 variables?

In the to_s method that is.

1 Answer

Without looking at it, I expect that the first three variables you mention are not assigned to Strings, so require interpolation, whereas the latter variables are already strings, so do not require interpolation.

Emily Coltman
Emily Coltman
Courses Plus Student 9,623 Points

It would be really helpful to have this explained in the video - in general, it would be really helpful to have more explanation for the different syntax. "We use a full stop here because... We use a colon here because..." and so forth.