зеркало из https://github.com/github/ruby.git
Update doc of Hash#slice [ci skip]
- Add arguments to call-seq - Add sample of multiple keys - Add sample: hash does not contain key git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
d9cfbb3cad
Коммит
a48704106d
5
hash.c
5
hash.c
|
@ -1326,13 +1326,14 @@ rb_hash_reject(VALUE hash)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* hsh.slice -> a_hash
|
||||
* hsh.slice(*keys) -> a_hash
|
||||
*
|
||||
* Slices a hash to include only the given keys.
|
||||
* Returns a hash containing the given keys.
|
||||
*
|
||||
* h = { "a" => 100, "b" => 200, "c" => 300 }
|
||||
* h.slice("a") #=> {"a" => 100}
|
||||
* h.slice("a") #=> {"a"=>100}
|
||||
* h.slice("c", "d") #=> {"c"=>300}
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
|
|
Загрузка…
Ссылка в новой задаче