Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Hash#>

[A, B] (::Hash[A, B]) -> bool
hash > other_hash → true or false

Returns true if hash is a proper 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 # => false
See also #>= #== #<= #[] also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0