hsh == other_hash â true or false
Instance Public methods
EqualityâTwo hashes are equal if they each contain the same number of keys
and if each key-value pair is equal to (according to
Object#==
) the corresponding elements in the other hash.
1 2 3 4 5 6 7 | h1 = { "a" => 1 , "c" => 2 } h2 = { 7 => 35 , "c" => 2 , "a" => 1 } h3 = { "a" => 1 , "c" => 2 , 7 => 35 } h4 = { "a" => 1 , "d" => 2 , "f" => 35 } h1 == h2 #=> false h2 == h3 #=> true h3 == h4 #=> false |
Please login to continue.