ruby-changes:70738
From: Burdette <ko1@a...>
Date: Wed, 5 Jan 2022 09:39:27 +0900 (JST)
Subject: [ruby-changes:70738] 6326112e16 (master): Enhanced RDoc for Enumerable (#5393)
https://git.ruby-lang.org/ruby.git/commit/?id=6326112e16 From 6326112e16352caad131f1f1580c4621eb7b1d3f Mon Sep 17 00:00:00 2001 From: Burdette Lamar <BurdetteLamar@Y...> Date: Tue, 4 Jan 2022 18:39:07 -0600 Subject: Enhanced RDoc for Enumerable (#5393) A little more about the classes that include or extend Enumerable. --- enum.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/enum.c b/enum.c index f8e327ff7f5..93041df2520 100644 --- a/enum.c +++ b/enum.c @@ -4777,26 +4777,42 @@ enum_compact(VALUE obj) https://github.com/ruby/ruby/blob/trunk/enum.c#L4777 * [1, 2] * nil * - * == \Enumerable in Ruby Core Classes - * Some Ruby classes include \Enumerable: + * == \Enumerable in Ruby Classes + * + * These Ruby core classes include (or extend) \Enumerable: + * + * - ARGF * - Array * - Dir + * - Enumerator + * - ENV (extends) * - Hash * - IO * - Range - * - Set * - Struct + * + * These Ruby standard library classes include \Enumerable: + * + * - CSV + * - CSV::Table + * - CSV::Row + * - Set + * * Virtually all methods in \Enumerable call method +#each+ in the including class: + * * - <tt>Hash#each</tt> yields the next key-value pair as a 2-element \Array. * - <tt>Struct#each</tt> yields the next name-value pair as a 2-element \Array. * - For the other classes above, +#each+ yields the next object from the collection. * * == About the Examples + * * The example code snippets for the \Enumerable methods: + * * - Always show the use of one or more \Array-like classes (often \Array itself). * - Sometimes show the use of a \Hash-like class. * For some methods, though, the usage would not make sense, * and so it is not shown. Example: #tally would find exactly one of each \Hash entry. + * */ void -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/