Vishnuprasad K

1 follower

Software Engineer | Tech Enthusiast | Cricketer

Blog Author Picture

Ruby | Safe Navigation Operator

Oct 22, 20201 min read

&., called “safe navigation operator”, allows to skip method call when receiver is nil. It returns nil and doesn't evaluate method's arguments if the call is skipped. The operator first appeared in Ruby 2.3. For instance, consider the Person class: c...

Ruby | Safe Navigation Operator
Ruby | try
Ruby | dig and fetch