I\'m just breaking into the ruby world and I could use a helping hand.
Suppose b is nil.
b
nil
I\'d like the following code to return n
n
To use a safe_nils similar to that you wrote:
safe_nils
def safe_nils &blk return blk.call rescue NoMethodError return nil end safe_nils { a.b.c("d").e }