From: Tim Wolak Date: 2008-05-14T23:53:09+09:00 Subject: changing hash key I've been looking for a way to change a hash key. In my code I'm trying to change the key from a number to a string. Do I need to convert the key to a string and put it new value in there or is my code wrong? Thanks in advance, Tim def numbers @skty = Hash.new(0) @sktynl.each do |key, value| if key <= "39" key = "SKTY" @skty[key] += value # !> instance variable @skty not initialized elsif key >="40" key = "SKYNY" @skty[key] += value end -- Posted via http://www.ruby-forum.com/.