Skip to content

Commit f918f6e

Browse files
[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
1 parent 69967ee commit f918f6e

File tree

4 files changed

+204
-194
lines changed

4 files changed

+204
-194
lines changed

array.c

Lines changed: 126 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -8174,163 +8174,165 @@ rb_ary_deconstruct(VALUE ary)
81748174
*
81758175
* === Methods for Creating an \Array
81768176
*
8177-
* ::[]:: Returns a new array populated with given objects.
8178-
* ::new:: Returns a new array.
8179-
* ::try_convert:: Returns a new array created from a given object.
8177+
* - ::[]: Returns a new array populated with given objects.
8178+
* - ::new: Returns a new array.
8179+
* - ::try_convert: Returns a new array created from a given object.
81808180
*
81818181
* === Methods for Querying
81828182
*
8183-
* #length, #size:: Returns the count of elements.
8184-
* #include?:: Returns whether any element <tt>==</tt> a given object.
8185-
* #empty?:: Returns whether there are no elements.
8186-
* #all?:: Returns whether all elements meet a given criterion.
8187-
* #any?:: Returns whether any element meets a given criterion.
8188-
* #none?:: Returns whether no element <tt>==</tt> a given object.
8189-
* #one?:: Returns whether exactly one element <tt>==</tt> a given object.
8190-
* #count:: Returns the count of elements that meet a given criterion.
8191-
* #find_index, #index:: Returns the index of the first element that meets a given criterion.
8192-
* #rindex:: Returns the index of the last element that meets a given criterion.
8193-
* #hash:: Returns the integer hash code.
8183+
* - #length, #size: Returns the count of elements.
8184+
* - #include?: Returns whether any element <tt>==</tt> a given object.
8185+
* - #empty?: Returns whether there are no elements.
8186+
* - #all?: Returns whether all elements meet a given criterion.
8187+
* - #any?: Returns whether any element meets a given criterion.
8188+
* - #none?: Returns whether no element <tt>==</tt> a given object.
8189+
* - #one?: Returns whether exactly one element <tt>==</tt> a given object.
8190+
* - #count: Returns the count of elements that meet a given criterion.
8191+
* - #find_index, #index: Returns the index of the first element that meets a given criterion.
8192+
* - #rindex: Returns the index of the last element that meets a given criterion.
8193+
* - #hash: Returns the integer hash code.
81948194
*
81958195
* === Methods for Comparing
81968196
8197-
* #<=>:: Returns -1, 0, or 1 as +self+ is less than, equal to, or greater than a given
8198-
* object.
8199-
* #==:: Returns whether each element in +self+ is <tt>==</tt> to the corresponding element
8200-
* in a given object.
8201-
* #eql?:: Returns whether each element in +self+ is <tt>eql?</tt> to the corresponding
8202-
* element in a given object.
8197+
* - {<=>}[Array.html#method-i-3C-3D-3E]: Returns -1, 0, or 1
8198+
* as +self+ is less than, equal to, or greater than a given object.
8199+
* - #==: Returns whether each element in +self+ is <tt>==</tt> to the corresponding element
8200+
* in a given object.
8201+
* - #eql?: Returns whether each element in +self+ is <tt>eql?</tt> to the corresponding
8202+
* element in a given object.
82038203
82048204
* === Methods for Fetching
82058205
*
82068206
* These methods do not modify +self+.
82078207
*
8208-
* #[]:: Returns one or more elements.
8209-
* #fetch:: Returns the element at a given offset.
8210-
* #first:: Returns one or more leading elements.
8211-
* #last:: Returns one or more trailing elements.
8212-
* #max:: Returns one or more maximum-valued elements,
8213-
* as determined by <tt><=></tt> or a given block.
8214-
* #min:: Returns one or more minimum-valued elements,
8215-
* as determined by <tt><=></tt> or a given block.
8216-
* #minmax:: Returns the minimum-valued and maximum-valued elements,
8217-
* as determined by <tt><=></tt> or a given block.
8218-
* #assoc:: Returns the first element that is an array
8219-
* whose first element <tt>==</tt> a given object.
8220-
* #rassoc:: Returns the first element that is an array
8221-
* whose second element <tt>==</tt> a given object.
8222-
* #at:: Returns the element at a given offset.
8223-
* #values_at:: Returns the elements at given offsets.
8224-
* #dig:: Returns the object in nested objects
8225-
* that is specified by a given index and additional arguments.
8226-
* #drop:: Returns trailing elements as determined by a given index.
8227-
* #take:: Returns leading elements as determined by a given index.
8228-
* #drop_while:: Returns trailing elements as determined by a given block.
8229-
* #take_while:: Returns leading elements as determined by a given block.
8230-
* #slice:: Returns consecutive elements as determined by a given argument.
8231-
* #sort:: Returns all elements in an order determined by <tt><=></tt> or a given block.
8232-
* #reverse:: Returns all elements in reverse order.
8233-
* #compact:: Returns an array containing all non-+nil+ elements.
8234-
* #select, #filter:: Returns an array containing elements selected by a given block.
8235-
* #uniq:: Returns an array containing non-duplicate elements.
8236-
* #rotate:: Returns all elements with some rotated from one end to the other.
8237-
* #bsearch:: Returns an element selected via a binary search
8238-
* as determined by a given block.
8239-
* #bsearch_index:: Returns the index of an element selected via a binary search
8240-
* as determined by a given block.
8241-
* #sample:: Returns one or more random elements.
8242-
* #shuffle:: Returns elements in a random order.
8208+
* - #[]: Returns one or more elements.
8209+
* - #fetch: Returns the element at a given offset.
8210+
* - #first: Returns one or more leading elements.
8211+
* - #last: Returns one or more trailing elements.
8212+
* - #max: Returns one or more maximum-valued elements,
8213+
* as determined by <tt><=></tt> or a given block.
8214+
* - #min: Returns one or more minimum-valued elements,
8215+
* as determined by <tt><=></tt> or a given block.
8216+
* - #minmax: Returns the minimum-valued and maximum-valued elements,
8217+
* as determined by <tt><=></tt> or a given block.
8218+
* - #assoc: Returns the first element that is an array
8219+
* whose first element <tt>==</tt> a given object.
8220+
* - #rassoc: Returns the first element that is an array
8221+
* whose second element <tt>==</tt> a given object.
8222+
* - #at: Returns the element at a given offset.
8223+
* - #values_at: Returns the elements at given offsets.
8224+
* - #dig: Returns the object in nested objects
8225+
* that is specified by a given index and additional arguments.
8226+
* - #drop: Returns trailing elements as determined by a given index.
8227+
* - #take: Returns leading elements as determined by a given index.
8228+
* - #drop_while: Returns trailing elements as determined by a given block.
8229+
* - #take_while: Returns leading elements as determined by a given block.
8230+
* - #slice: Returns consecutive elements as determined by a given argument.
8231+
* - #sort: Returns all elements in an order determined by <tt><=></tt> or a given block.
8232+
* - #reverse: Returns all elements in reverse order.
8233+
* - #compact: Returns an array containing all non-+nil+ elements.
8234+
* - #select, #filter: Returns an array containing elements selected by a given block.
8235+
* - #uniq: Returns an array containing non-duplicate elements.
8236+
* - #rotate: Returns all elements with some rotated from one end to the other.
8237+
* - #bsearch: Returns an element selected via a binary search
8238+
* as determined by a given block.
8239+
* - #bsearch_index: Returns the index of an element selected via a binary search
8240+
* as determined by a given block.
8241+
* - #sample: Returns one or more random elements.
8242+
* - #shuffle: Returns elements in a random order.
82438243
*
82448244
* === Methods for Assigning
82458245
*
82468246
* These methods add, replace, or reorder elements in +self+.
82478247
*
8248-
* #[]=:: Assigns specified elements with a given object.
8249-
* #push, #append, #<<:: Appends trailing elements.
8250-
* #unshift, #prepend:: Prepends leading elements.
8251-
* #insert:: Inserts given objects at a given offset; does not replace elements.
8252-
* #concat:: Appends all elements from given arrays.
8253-
* #fill:: Replaces specified elements with specified objects.
8254-
* #replace:: Replaces the content of +self+ with the content of a given array.
8255-
* #reverse!:: Replaces +self+ with its elements reversed.
8256-
* #rotate!:: Replaces +self+ with its elements rotated.
8257-
* #shuffle!:: Replaces +self+ with its elements in random order.
8258-
* #sort!:: Replaces +self+ with its elements sorted,
8259-
* as determined by <tt><=></tt> or a given block.
8260-
* #sort_by!:: Replaces +self+ with its elements sorted, as determined by a given block.
8248+
* - #[]=: Assigns specified elements with a given object.
8249+
* - #push, #append, #<<: Appends trailing elements.
8250+
* - #unshift, #prepend: Prepends leading elements.
8251+
* - #insert: Inserts given objects at a given offset; does not replace elements.
8252+
* - #concat: Appends all elements from given arrays.
8253+
* - #fill: Replaces specified elements with specified objects.
8254+
* - #replace: Replaces the content of +self+ with the content of a given array.
8255+
* - #reverse!: Replaces +self+ with its elements reversed.
8256+
* - #rotate!: Replaces +self+ with its elements rotated.
8257+
* - #shuffle!: Replaces +self+ with its elements in random order.
8258+
* - #sort!: Replaces +self+ with its elements sorted,
8259+
* as determined by <tt><=></tt> or a given block.
8260+
* - #sort_by!: Replaces +self+ with its elements sorted, as determined by a given block.
82618261
*
82628262
* === Methods for Deleting
82638263
*
82648264
* Each of these methods removes elements from +self+:
82658265
*
8266-
* #pop:: Removes and returns the last element.
8267-
* #shift:: Removes and returns the first element.
8268-
* #compact!:: Removes all non-+nil+ elements.
8269-
* #delete:: Removes elements equal to a given object.
8270-
* #delete_at:: Removes the element at a given offset.
8271-
* #delete_if:: Removes elements specified by a given block.
8272-
* #keep_if:: Removes elements not specified by a given block.
8273-
* #reject!:: Removes elements specified by a given block.
8274-
* #select!, #filter!:: Removes elements not specified by a given block.
8275-
* #slice!:: Removes and returns a sequence of elements.
8276-
* #uniq!:: Removes duplicates.
8266+
* - #pop: Removes and returns the last element.
8267+
* - #shift: Removes and returns the first element.
8268+
* - #compact!: Removes all non-+nil+ elements.
8269+
* - #delete: Removes elements equal to a given object.
8270+
* - #delete_at: Removes the element at a given offset.
8271+
* - #delete_if: Removes elements specified by a given block.
8272+
* - #keep_if: Removes elements not specified by a given block.
8273+
* - #reject!: Removes elements specified by a given block.
8274+
* - #select!, #filter!: Removes elements not specified by a given block.
8275+
* - #slice!: Removes and returns a sequence of elements.
8276+
* - #uniq!: Removes duplicates.
82778277
*
82788278
* === Methods for Combining
82798279
*
8280-
* #&:: Returns an array containing elements found both in +self+ and a given array.
8281-
* #intersection:: Returns an array containing elements found both in +self+
8282-
* and in each given array.
8283-
* #+:: Returns an array containing all elements of +self+ followed by all elements of a given array.
8284-
* #-:: Returns an array containiing all elements of +self+ that are not found in a given array.
8285-
* #|:: Returns an array containing all elements of +self+ and all elements of a given array,
8286-
* duplicates removed.
8287-
* #union:: Returns an array containing all elements of +self+ and all elements of given arrays,
8288-
* duplicates removed.
8289-
* #difference:: Returns an array containing all elements of +self+ that are not found
8290-
* in any of the given arrays..
8291-
* #product:: Returns or yields all combinations of elements from +self+ and given arrays.
8280+
* - {&}[Array.html#method-i-26]: Returns an array containing elements found both in +self+ and a given array.
8281+
* - #intersection: Returns an array containing elements found both in +self+
8282+
* and in each given array.
8283+
* - #+: Returns an array containing all elements of +self+ followed by all elements of a given array.
8284+
* - #-: Returns an array containiing all elements of +self+ that are not found in a given array.
8285+
* - {|}[Array.html#method-i-7C]: Returns an array containing all elements of +self+ and all elements of a given array,
8286+
* duplicates removed.
8287+
* - #union: Returns an array containing all elements of +self+ and all elements of given arrays,
8288+
* duplicates removed.
8289+
* - #difference: Returns an array containing all elements of +self+ that are not found
8290+
* in any of the given arrays..
8291+
* - #product: Returns or yields all combinations of elements from +self+ and given arrays.
82928292
*
82938293
* === Methods for Iterating
82948294
*
8295-
* #each:: Passes each element to a given block.
8296-
* #reverse_each:: Passes each element, in reverse order, to a given block.
8297-
* #each_index:: Passes each element index to a given block.
8298-
* #cycle:: Calls a given block with each element, then does so again,
8299-
* for a specified number of times, or forever.
8300-
* #combination:: Calls a given block with combinations of elements of +self+;
8301-
* a combination does not use the same element more than once.
8302-
* #permutation:: Calls a given block with permutations of elements of +self+;
8303-
* a permutation does not use the same element more than once.
8304-
* #repeated_combination:: Calls a given block with combinations of elements of +self+;
8305-
* a combination may use the same element more than once.
8306-
* #repeated_permutation:: Calls a given block with permutations of elements of +self+;
8307-
* a permutation may use the same element more than once.
8295+
* - #each: Passes each element to a given block.
8296+
* - #reverse_each: Passes each element, in reverse order, to a given block.
8297+
* - #each_index: Passes each element index to a given block.
8298+
* - #cycle: Calls a given block with each element, then does so again,
8299+
* for a specified number of times, or forever.
8300+
* - #combination: Calls a given block with combinations of elements of +self+;
8301+
* a combination does not use the same element more than once.
8302+
* - #permutation: Calls a given block with permutations of elements of +self+;
8303+
* a permutation does not use the same element more than once.
8304+
* - #repeated_combination: Calls a given block with combinations of elements of +self+;
8305+
* a combination may use the same element more than once.
8306+
* - #repeated_permutation: Calls a given block with permutations of elements of +self+;
8307+
* a permutation may use the same element more than once.
83088308
*
83098309
* === Methods for Converting
83108310
*
8311-
* #map, #collect:: Returns an array containing the block return-value for each element.
8312-
* #map!, #collect!:: Replaces each element with a block return-value.
8313-
* #flatten:: Returns an array that is a recursive flattening of +self+.
8314-
* #flatten!:: Replaces each nested array in +self+ with the elements from that array.
8315-
* #inspect, #to_s:: Returns a new String containing the elements.
8316-
* #join:: Returns a newsString containing the elements joined by the field separator.
8317-
* #to_a:: Returns +self+ or a new array containing all elements.
8318-
* #to_ary:: Returns +self+.
8319-
* #to_h:: Returns a new hash formed from the elements.
8320-
* #transpose:: Transposes +self+, which must be an array of arrays.
8321-
* #zip:: Returns a new array of arrays containing +self+ and given arrays;
8322-
* follow the link for details.
8311+
* - #map, #collect: Returns an array containing the block return-value for each element.
8312+
* - #map!, #collect!: Replaces each element with a block return-value.
8313+
* - #flatten: Returns an array that is a recursive flattening of +self+.
8314+
* - #flatten!: Replaces each nested array in +self+ with the elements from that array.
8315+
* - #inspect, #to_s: Returns a new String containing the elements.
8316+
* - #join: Returns a newsString containing the elements joined by the field separator.
8317+
* - #to_a: Returns +self+ or a new array containing all elements.
8318+
* - #to_ary: Returns +self+.
8319+
* - #to_h: Returns a new hash formed from the elements.
8320+
* - #transpose: Transposes +self+, which must be an array of arrays.
8321+
* - #zip: Returns a new array of arrays containing +self+ and given arrays;
8322+
* follow the link for details.
83238323
*
83248324
* === Other Methods
83258325
*
8326-
* #*:: Returns one of the following:
8327-
* - With integer argument +n+, a new array that is the concatenation
8328-
* of +n+ copies of +self+.
8329-
* - With string argument +field_separator+, a new string that is equivalent to
8330-
* <tt>join(field_separator)</tt>.
8331-
* #abbrev:: Returns a hash of unambiguous abbreviations for elements.
8332-
* #pack:: Packs the elements into a binary sequence.
8333-
* #sum:: Returns a sum of elements according to either <tt>+</tt> or a given block.
8326+
* - #*: Returns one of the following:
8327+
*
8328+
* - With integer argument +n+, a new array that is the concatenation
8329+
* of +n+ copies of +self+.
8330+
* - With string argument +field_separator+, a new string that is equivalent to
8331+
* <tt>join(field_separator)</tt>.
8332+
*
8333+
* - #abbrev: Returns a hash of unambiguous abbreviations for elements.
8334+
* - #pack: Packs the elements into a binary sequence.
8335+
* - #sum: Returns a sum of elements according to either <tt>+</tt> or a given block.
83348336
*/
83358337

83368338
void

compar.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,22 @@ cmp_clamp(int argc, VALUE *argv, VALUE x)
288288
*
289289
* \Module \Comparable provides these methods, all of which use method <tt><=></tt>:
290290
*
291-
* - #<:: Returns whether +self+ is less than the given object.
292-
* - #<=:: Returns whether +self+ is less than or equal to the given object.
293-
* - #==:: Returns whether +self+ is equal to the given object.
294-
* - #>:: Returns whether +self+ is greater than or equal to the given object.
295-
* - #>=:: Returns whether +self+ is greater than the given object.
296-
* - #between? Returns +true+ if +self+ is between two given objects.
297-
* - #clamp:: For given objects +min+ and +max+, or range <tt>(min..max)</tt>, returns:
291+
* - {<}[Comparable.html#method-i-3C]:
292+
* Returns whether +self+ is less than the given object.
293+
* - {<=}[Comparable.html#method-i-3C-3D]:
294+
* Returns whether +self+ is less than or equal to the given object.
295+
* - #==: Returns whether +self+ is equal to the given object.
296+
* - {>}[Comparable.html#method-i-3E]:
297+
* Returns whether +self+ is greater than or equal to the given object.
298+
* - {>=}[Comparable.html#method-i-3E-3D]:
299+
* Returns whether +self+ is greater than the given object.
300+
* - #between?: Returns +true+ if +self+ is between two given objects.
301+
* - #clamp: For given objects +min+ and +max+, or range <tt>(min..max)</tt>, returns:
302+
*
298303
* - +min+ if <tt>(self <=> min) < 0</tt>.
299304
* - +max+ if <tt>(self <=> max) > 0</tt>.
300305
* - +self+ otherwise.
306+
*
301307
*/
302308

303309
void

0 commit comments

Comments
 (0)