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

Nicolas Filzi
Nicolas Filzi
17,489 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

Andrew Stelmach
Andrew Stelmach
12,372 Points

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
Pro 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.