diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-22 23:37:03 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-22 23:37:03 +0000 |
commit | 317e2a50212b209d5972494b2ded191178d40bec (patch) | |
tree | 4be4d3fdc5ed3a8d804709356a0becf7ff92feba /hash.c | |
parent | 6cfb4b614a5e1b59354a2cc33a9be8278f3142de (diff) | |
download | ruby-317e2a50212b209d5972494b2ded191178d40bec.tar.gz |
* hash.c: Improve documentation of Hash#key. Patch by Utkarsh
Kukreti. [Ruby 1.9 - Bug #4760]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -740,10 +740,12 @@ key_i(VALUE key, VALUE value, VALUE arg) * call-seq: * hsh.key(value) -> key * - * Returns the key for a given value. If not found, returns <code>nil</code>. + * Returns the key of the first occurrence of a given value. If the value is + * not found, returns <code>nil</code>. * - * h = { "a" => 100, "b" => 200 } + * h = { "a" => 100, "b" => 200, "c" => 300, "d" => 300 } * h.key(200) #=> "b" + * h.key(300) #=> "c" * h.key(999) #=> nil * */ |