参考: http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/
ruby 2.3 之后,有这样的特性: &. 和 dig.
总之,
if account && account.owner && account.owner.address
可以写成:
if account.try(:owner).try(:address)
等同于
if account &.owner &.address
对于dig, 也有同样的道理:
account.try([], :owner).try([], :address)
等同于:
account.dig(:owner, :address)