h = {'a'=>'aaa',2=>'bbb'}h.each do |a,b| puts a.to_s+"--"+b.to_send#该片段来自于http://www.codesnippet.cn/detail/040620133758.html
来源: http://www.codesnippet.cn/detail/040620133758.html