diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-07-26 16:57:42 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-07-26 16:57:42 -0700 |
commit | 6279cf8b2b2a683cb9e4f6422e6f6f9351cff37b (patch) | |
tree | cd01e1285b3055210ab8c0b3195f345f11ee8341 | |
parent | bd3283338250827e0f9e2fd1785bd1fd4151e66d (diff) | |
download | ruby-6279cf8b2b2a683cb9e4f6422e6f6f9351cff37b.tar.gz |
Restore documentation for Object#hash [ci skip]
Object#hash documentation was removed (probably by accident) in
7b19e6f3fdf8b0238752cb1561dfe42a283f5308.
-rw-r--r-- | object.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -205,6 +205,25 @@ rb_obj_equal(VALUE obj1, VALUE obj2) return Qfalse; } +/** + * call-seq: + * obj.hash -> integer + * + * Generates an Integer hash value for this object. This function must have the + * property that <code>a.eql?(b)</code> implies <code>a.hash == b.hash</code>. + * + * The hash value is used along with #eql? by the Hash class to determine if + * two objects reference the same hash key. Any hash value that exceeds the + * capacity of an Integer will be truncated before being used. + * + * The hash value for an object may not be identical across invocations or + * implementations of Ruby. If you need a stable identifier across Ruby + * invocations and implementations you will need to generate one with a custom + * method. + *-- + * \private + *++ + */ VALUE rb_obj_hash(VALUE obj); /** |