0
我覺得自己需要把衛士這樣的:紅寶石散列/子哈希所有腦幹檢查
if hash[:foo] && hash[:foo][:bar] && hash[:foo][:bar][:baz]
puts hash[:foo][:bar][:baz]
end
我想縮短這個以某種方式;我知道我可以包裹在開始/救援塊中,但看起來更糟糕。也許是這樣的: ruby Hash include another hash, deep check
我喜歡這樣。填充。 –