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

Just as empty? tells you if an array is empty, it also tells you if a hash has no key-value pairs:

>> our_heroes.empty?
=> false
>> empty_hash = {}
>> empty_hash.empty?
=> true

From

Cover of Ruby Wizardry

Note

calling empty? on a hash.