summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2022-01-04 18:39:07 -0600
committerGitHub <noreply@github.com>2022-01-04 18:39:07 -0600
commit6326112e16352caad131f1f1580c4621eb7b1d3f (patch)
tree711af12762b827bb1eafe810cbb5e62c41192e07
parentd5836db1b398a7936b0461b3011db66f6cc8c490 (diff)
Enhanced RDoc for Enumerable (#5393)
A little more about the classes that include or extend Enumerable.
Notes
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
-rw-r--r--enum.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/enum.c b/enum.c
index f8e327ff7f..93041df252 100644
--- a/enum.c
+++ b/enum.c
@@ -4777,26 +4777,42 @@ enum_compact(VALUE obj)
* [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