diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-08-24 09:09:53 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-08-24 09:09:53 -0700 |
commit | e1c991f8d783440411e5bf4faf3f0923cef4a0e1 (patch) | |
tree | d6828d42f29676f4bdf659ed100e3a90025cc740 /hash.c | |
parent | cf5516de7bff474030a820b63788e12f0b8b93d6 (diff) | |
download | ruby-e1c991f8d783440411e5bf4faf3f0923cef4a0e1.tar.gz |
Move Object#hash rdoc to hash.c [ci skip]
This gets RDoc to pick up the documentation correctly.
Problem pointed out by zverok (Victor Shepelev).
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -280,6 +280,25 @@ objid_hash(VALUE obj) #endif } +/** + * 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) { |