RubySyntax
Safe Navigation
Code example
user&.nameCalls a method only if the object isn't nil.
In Ruby, safe navigation: calls a method only if the object isn't nil — user&.name
user&.nameuser&.nameCalls a method only if the object isn't nil.
Use user&.name.
Use this pattern: user&.name
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.