each_pair

来源:互联网 发布:2017年病退工资的算法 编辑:程序博客网 时间:2024/06/15 22:20
h = Hash.new
h[1] = 2
h[2] = 4
h.each_pair { |key, value|
print key, "=>", value, "/n"
}
#1=>2
#2=>4