The method is hashdefined for all objects. See documentation :
Creates a hash value Fixnumfor this object. This function must have the property a.eql?(b)attracts a.hash == b.hash. The hash value is used by the class hash. Any hash value that exceeds the capacity of a is Fixnumtruncated before use.
, String.hash C-Code. () .