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

* enum.c (group_by): Improve group_by description. Patch by b t. [#5411]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-10-07 23:55:41 +00:00
parent ee1acd6a83
commit 82f1f640ec
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Sat Oct 8 08:54:56 2011 Eric Hodel <drbrain@segment7.net>
* enum.c (group_by): Improve group_by description. Patch by b t.
[#5411]
Sat Oct 8 03:17:51 2011 Eric Hodel <drbrain@segment7.net>
* lib/shell.rb: Document some methods of Shell. Patch by Carol

6
enum.c
View file

@ -658,12 +658,12 @@ group_by_i(VALUE i, VALUE hash, int argc, VALUE *argv)
* enum.group_by -> an_enumerator
*
* Groups the collection by result of the block. Returns a hash where the
* keys are the evaluated result from the block and values the values are
* arrays of elements in the collection that corresponding to the key.
* keys are the evaluated result from the block and the values are
* arrays of elements in the collection that correspond to the key.
*
* If no block is given an enumerator is returned.
*
* (1..6).group_by {|i| i%3} #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
* (1..6).group_by { |i| i%3 } #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
*
*/