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

K .
K .
2,356 Points

Question about full_name method

Hey, so I'm having a hard time fully understanding why in the full_name method we have the "@" in front of middle_name.nil? I tried both with and without the "@" and my code still works the same. Could someone better explain why we use this?

Thanks in advance.

1 Answer

KRIS NIKOLAISEN
KRIS NIKOLAISEN
54,332 Points

Here is an answer from Stack Overflow

Enrica Fedeli-Jaques
Enrica Fedeli-Jaques
6,773 Points

KRIS NIKOLAISEN thank you for the link, but I was wondering too, and couldn't find an answer in the link, why does Jason only use it in the if statement?