Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Range#hash

hash → integer

Returns the integer hash value for self. Two range objects r0 and r1 have the same hash value if and only if r0.eql?(r1).

Related: Range#eql?, Object#hash.

See also #first #include? #exclude_end? #inspect also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0