see if it has a given value with value? or has_value?: : has_value « Hash « Ruby






see if it has a given value with value? or has_value?:


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

zip.has_value? "One" # => true

 








Related examples in the same category

1.Is it a value in the hash