diff options
author | Burdette Lamar <BurdetteLamar@Yahoo.com> | 2022-03-25 10:52:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 10:52:06 -0500 |
commit | f918f6e4e74541a184a15762a8593fb3f1b9614d (patch) | |
tree | 1ba4cbb539f3a0f7c94ea98b55cc2cdc9aeb74d1 /enum.c | |
parent | 69967ee64eac9ce65b83533a566d69d12a6046d0 (diff) |
[DOC] Repair format and links in What's Here sections (#5711)
* Repair format and links in What's Here for Comparable and Array
* Repair format for What's Here in enum.c
Notes
Notes:
Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 126 |
1 files changed, 65 insertions, 61 deletions
@@ -4658,6 +4658,7 @@ enum_compact(VALUE obj) * == What's Here * * \Module \Enumerable provides methods that are useful to a collection class for: + * * - {Querying}[rdoc-ref:Enumerable@Methods+for+Querying] * - {Fetching}[rdoc-ref:Enumerable@Methods+for+Fetching] * - {Searching}[rdoc-ref:Enumerable@Methods+for+Searching] @@ -4669,91 +4670,94 @@ enum_compact(VALUE obj) * * These methods return information about the \Enumerable other than the elements themselves: * - * #include?, #member?:: Returns +true+ if self == object, +false+ otherwise. - * #all?:: Returns +true+ if all elements meet a specified criterion; +false+ otherwise. - * #any?:: Returns +true+ if any element meets a specified criterion; +false+ otherwise. - * #none?:: Returns +true+ if no element meets a specified criterion; +false+ otherwise. - * #one?:: Returns +true+ if exactly one element meets a specified criterion; +false+ otherwise. - * #count:: Returns the count of elements, - * based on an argument or block criterion, if given. - * #tally:: Returns a new \Hash containing the counts of occurrences of each element. + * - #include?, #member?: Returns +true+ if <tt>self == object</tt>, +false+ otherwise. + * - #all?: Returns +true+ if all elements meet a specified criterion; +false+ otherwise. + * - #any?: Returns +true+ if any element meets a specified criterion; +false+ otherwise. + * - #none?: Returns +true+ if no element meets a specified criterion; +false+ otherwise. + * - #one?: Returns +true+ if exactly one element meets a specified criterion; +false+ otherwise. + * - #count: Returns the count of elements, + * based on an argument or block criterion, if given. + * - #tally: Returns a new \Hash containing the counts of occurrences of each element. * * === Methods for Fetching * * These methods return entries from the \Enumerable, without modifying it: * * <i>Leading, trailing, or all elements</i>: - * #entries, #to_a:: Returns all elements. - * #first:: Returns the first element or leading elements. - * #take:: Returns a specified number of leading elements. - * #drop:: Returns a specified number of trailing elements. - * #take_while:: Returns leading elements as specified by the given block. - * #drop_while:: Returns trailing elements as specified by the given block. + * + * - #entries, #to_a: Returns all elements. + * - #first: Returns the first element or leading elements. + * - #take: Returns a specified number of leading elements. + * - #drop: Returns a specified number of trailing elements. + * - #take_while: Returns leading elements as specified by the given block. + * - #drop_while: Returns trailing elements as specified by the given block. * * <i>Minimum and maximum value elements</i>: - * #min:: Returns the elements whose values are smallest among the elements, - * as determined by <tt><=></tt> or a given block. - * #max:: Returns the elements whose values are largest among the elements, - * as determined by <tt><=></tt> or a given block. - * #minmax:: Returns a 2-element \Array containing the smallest and largest elements. - * #min_by:: Returns the smallest element, as determined by the given block. - * #max_by:: Returns the largest element, as determined by the given block. - * #minmax_by:: Returns the smallest and largest elements, as determined by the given block. + * + * - #min: Returns the elements whose values are smallest among the elements, + * as determined by <tt><=></tt> or a given block. + * - #max: Returns the elements whose values are largest among the elements, + * as determined by <tt><=></tt> or a given block. + * - #minmax: Returns a 2-element \Array containing the smallest and largest elements. + * - #min_by: Returns the smallest element, as determined by the given block. + * - #max_by: Returns the largest element, as determined by the given block. + * - #minmax_by: Returns the smallest and largest elements, as determined by the given block. * * <i>Groups, slices, and partitions</i>: - * #group_by:: Returns a \Hash that partitions the elements into groups. - * #partition:: Returns elements partitioned into two new Arrays, as determined by the given block. - * #slice_after:: Returns a new \Enumerator whose entries are a partition of +self+, - based either on a given +object+ or a given block. - * #slice_before:: Returns a new \Enumerator whose entries are a partition of +self+, - based either on a given +object+ or a given block. - * #slice_when:: Returns a new \Enumerator whose entries are a partition of +self+ - based on the given block. - * #chunk:: Returns elements organized into chunks as specified by the given block. - * #chunk_while:: Returns elements organized into chunks as specified by the given block. + * + * - #group_by: Returns a \Hash that partitions the elements into groups. + * - #partition: Returns elements partitioned into two new Arrays, as determined by the given block. + * - #slice_after: Returns a new \Enumerator whose entries are a partition of +self+, + based either on a given +object+ or a given block. + * - #slice_before: Returns a new \Enumerator whose entries are a partition of +self+, + based either on a given +object+ or a given block. + * - #slice_when: Returns a new \Enumerator whose entries are a partition of +self+ + based on the given block. + * - #chunk: Returns elements organized into chunks as specified by the given block. + * - #chunk_while: Returns elements organized into chunks as specified by the given block. * * === Methods for Searching and Filtering * - * These methods return elements that meet a specified criterion. + * These methods return elements that meet a specified criterion: * - * #find, #detect:: Returns an element selected by the block. - * #find_all, #filter, #select:: Returns elements selected by the block. - * #find_index:: Returns the index of an element selected by a given object or block. - * #reject:: Returns elements not rejected by the block. - * #uniq:: Returns elements that are not duplicates. + * - #find, #detect: Returns an element selected by the block. + * - #find_all, #filter, #select: Returns elements selected by the block. + * - #find_index: Returns the index of an element selected by a given object or block. + * - #reject: Returns elements not rejected by the block. + * - #uniq: Returns elements that are not duplicates. * * === Methods for Sorting * - * These methods return elements in sorted order. + * These methods return elements in sorted order: * - * #sort:: Returns the elements, sorted by <tt><=></tt> or the given block. - * #sort_by:: Returns the elements, sorted by the given block. + * - #sort: Returns the elements, sorted by <tt><=></tt> or the given block. + * - #sort_by: Returns the elements, sorted by the given block. * * === Methods for Iterating * - * #each_entry:: Calls the block with each successive element - * (slightly different from #each). - * #each_with_index:: Calls the block with each successive element and its index. - * #each_with_object:: Calls the block with each successive element and a given object. - * #each_slice:: Calls the block with successive non-overlapping slices. - * #each_cons:: Calls the block with successive overlapping slices. - * (different from #each_slice). - * #reverse_each:: Calls the block with each successive element, in reverse order. + * - #each_entry: Calls the block with each successive element + * (slightly different from #each). + * - #each_with_index: Calls the block with each successive element and its index. + * - #each_with_object: Calls the block with each successive element and a given object. + * - #each_slice: Calls the block with successive non-overlapping slices. + * - #each_cons: Calls the block with successive overlapping slices. + * (different from #each_slice). + * - #reverse_each: Calls the block with each successive element, in reverse order. * * === Other Methods * - * #map, #collect:: Returns objects returned by the block. - * #filter_map:: Returns truthy objects returned by the block. - * #flat_map, #collect_concat:: Returns flattened objects returned by the block. - * #grep:: Returns elements selected by a given object - * or objects returned by a given block. - * #grep_v:: Returns elements selected by a given object - * or objects returned by a given block. - * #reduce, #inject:: Returns the object formed by combining all elements. - * #sum:: Returns the sum of the elements, using method +++. - * #zip:: Combines each element with elements from other enumerables; - * returns the n-tuples or calls the block with each. - * #cycle:: Calls the block with each element, cycling repeatedly. + * - #map, #collect: Returns objects returned by the block. + * - #filter_map: Returns truthy objects returned by the block. + * - #flat_map, #collect_concat: Returns flattened objects returned by the block. + * - #grep: Returns elements selected by a given object + * or objects returned by a given block. + * - #grep_v: Returns elements selected by a given object + * or objects returned by a given block. + * - #reduce, #inject: Returns the object formed by combining all elements. + * - #sum: Returns the sum of the elements, using method +++. + * - #zip: Combines each element with elements from other enumerables; + * returns the n-tuples or calls the block with each. + * - #cycle: Calls the block with each element, cycling repeatedly. * * == Usage * |