From: "Antonio Fernández vara" Date: 2011-10-03T16:42:55+09:00 Subject: Need some help with hashes, don't know what fails Hi all, I have a hash that contains other hashes, now I'm trying to retreive the information on those but I can't get the values inside. Just this code for explain what happens to me: Im using ruby-1.9.2-p136. ## just a sample notifications = Hash.new notifications['1'] = { what: 'text', who: 'Antonio', when: Time.now} notifications['2'] = { what: 'text', who: 'Alfonso', when: Time.now} notifications['3'] = { what: 'text', who: 'Alberto', when: Time.now} notifications.each do |key, value| puts key.inspect # Getting: '1', '2','3' correct puts value.inspect # Getting: { what: 'text', who: 'Antonio', when: Time.now} and so on. Correct puts value.class # Getting: Hash. Correct puts value.has_key?('what') # Getting false. Incorrect puts value.has_key?('when') # Getting false. Incorrect puts value.has_key?('data') # Getting false. Incorrect # I get the values.... value.each do | k, v | puts "#{k}: #{v}" end end Thanks in advance. -- Posted via http://www.ruby-forum.com/.