Mega Code Archive

 
Categories / Ruby / Hash
 

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