instance method
Hash#empty?
() -> bool
empty? → true or false
hash.c
View on GitHub ↗
VALUE
rb_hash_empty_p(VALUE hash)
{
return RBOOL(RHASH_EMPTY_P(hash));
}
Returns true if there are no hash entries, false otherwise:
Example
{}.empty? # => true
{foo: 0}.empty? # => false
Related: see Methods for Querying.