End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Hash#>=
hash >= other_hash → true or false
hash.c
View on GitHub ↗
static VALUE
rb_hash_ge(VALUE hash, VALUE other)
{
other = to_hash(other);
if (RHASH_SIZE(hash) < RHASH_SIZE(other)) return Qfalse;
return hash_le(other, hash);
}
Returns true if hash is a superset of other_hash, false otherwise:
Example
h1 = {foo: 0, bar: 1, baz: 2} h2 = {foo: 0, bar: 1} h1 >= h2 # => true h2 >= h1 # => false h1 >= h1 # => true