From: Tim Uckun Date: 2006-05-11T13:32:15+09:00 Subject: A more elegant way to do this? Can anybody suggest a more elegant and rubyish way to do this? I am reading a YAML file and then trying to iterate over arrays andhashes that may or may not be there. unless conf['hosts'][hostname]['groups'].nil? conf['hosts'][hostname]['groups'].each { |group| unless conf['crontables'][group].nil? conf['crontables'][group].each { | tab_item| tab_entries << tab_item } end #Unless } end #unless