Skip to content
instance method

Hash#hash

() -> ::Integer
hash → an_integer

Returns the integer hash-code for the hash.

Two hashes have the same hash-code if their content is the same (regardless of order):

Example
h1 = {foo: 0, bar: 1, baz: 2}
h2 = {baz: 2, bar: 1, foo: 0}
h2.hash == h1.hash # => true
h2.eql? h1 # => true

Related: see Methods for Querying.

See also #flatten #has_key? #filter! #has_value? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0