The each_value method passes all the values to a block : each_value « Hash « Ruby






The each_value method passes all the values to a block


zip = { 1 => "One", 2 => "Two", 3 => "Three",
4 => "Four", 5 => "Five", 6 => "Six", 7 =>
"Seven", 8 => "Eight", 9 => "Eight" }


zip.each_value { |value| print value, " " } 

 








Related examples in the same category

1.Loop through all values