From: Ibrahim Dogru Date: 2008-03-05T17:53:19+09:00 Subject: Re: Newbea question again? > @b = false > def check h, key > h.each { |k, h| @b ||= h.keys.include?(key) || check(h, key) rescue > false; @b} > end > hsh = YAML.load_file("your_file.yml") > puts check(hsh, "template_of_roster") > puts check(hsh, "template_of_roster3") > => false > => true > If your hashes are not nested (i.e. you have one level that you are > concerned about), then all you should just use use > h["template1"].keys.include? > hth, thank you very much.. > Todd -- Posted via http://www.ruby-forum.com/.