1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

hash.c: improve docs for Hash#{size,length}

* hash.c: [DOC] shorten example code for Hash#{size,length}
  and mention aliases at the end; also enable links.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
stomar 2018-10-12 19:56:53 +00:00
parent 1821e9f4dc
commit 60990b9a16

7
hash.c
View file

@ -1731,15 +1731,14 @@ rb_hash_replace(VALUE hash, VALUE hash2)
* hsh.size -> integer
*
* Returns the number of key-value pairs in the hash.
* <code>Hash#length</code> and <code>Hash#size</code> are both equivalent to
* each other.
*
* h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 }
* h.length #=> 4
* h.size #=> 4
* h.delete("a") #=> 200
* h.length #=> 3
* h.size #=> 3
* h.length #=> 3
*
* Hash#length is an alias for Hash#size.
*/
VALUE