method

each_pair

v1_9_1_378 - Show latest stable - Class: Hash
each_pair()
public

Calls block once for each key in hsh, passing the key-value pair as parameters.

h = { "a" => 100, "b" => 200 }
h.each {|key, value| puts "#{key} is #{value}" }

produces:

a is 100
b is 200