O'Reilly logo
  • Ronald Cosentino thinks this is interesting:

And last but not least, you can use some brand-new hash methods, has_key? and has_value?, to check whether a hash contains a certain key or value:

>> our_heroes.has_key?(:ruben)
=> true
>> our_heroes.has_key?(:trady_blix)
=> false
>> our_heroes.has_value?('a fry cook at the Hashery')
=> true

From

Cover of Ruby Wizardry

Note

has_key (:ruben)