Starting from ruby v2.3.0 there is another way built into the language, the safe navigation operator (&.)
You can write: a&.b&.c&.d
and you will safely get nil if one of the calls in the chain returns nil.
You can read more about it here:
http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/