ハッシュのkeyを順番に処理
Top > Ruby [2.2.2] > Hash( each_key )
hash = {:acha=>0, :porute=>1, "piipo"=>2} hash.each_key{ |key| puts "key -> #{key}" } # key -> acha # key -> porute # key -> piipo hash.each_key{ |key, value| puts "key -> #{key} , value -> #{value}" } # key -> acha , value -> # key -> porute , value -> # key -> piipo , value ->