Comparing hash members to other hash members
Convert the Hashes to Arrays, then use the difference operations on them.

a = { :a =&gt; 1, :b =&gt; 2, :c =&gt; 2 }
b = { :a =&gt; 1 }

p (b.to_a - a.to_a).empty?


You can do other things, like identify if two Hashes overlap in any places, by use the intersection too:

p (a.to_a &amp; b.to_a).any?