Skip to content

Commit

Permalink
[DOC] Improve doc guide compliance (#8221)
Browse files Browse the repository at this point in the history
  • Loading branch information
BurdetteLamar committed Aug 15, 2023
1 parent d9d4ae5 commit 8c5b9eb
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions array.rb
Expand Up @@ -81,7 +81,7 @@ def sample(n = (ary = false), random: Random)
#
# If +self+ is empty, returns +nil+.
#
# When non-negative \Integer argument +n+ is given,
# When non-negative Integer argument +n+ is given,
# returns the first +n+ elements in a new \Array:
#
# a = [:foo, 'bar', 2]
Expand Down Expand Up @@ -125,7 +125,7 @@ def first n = unspecified = true
#
# If +self+ is empty, returns +nil+.
#
# When non-negative \Integer argument +n+ is given,
# When non-negative Integer argument +n+ is given,
# returns the last +n+ elements in a new \Array:
#
# a = [:foo, 'bar', 2]
Expand Down
36 changes: 18 additions & 18 deletions enum.c
Expand Up @@ -354,7 +354,7 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
* {foo: 0, bar: 1, baz: 2}.find {|key, value| key.start_with?('b') } # => [:bar, 1]
* {foo: 0, bar: 1, baz: 2}.find(proc {[]}) {|key, value| key.start_with?('c') } # => []
*
* With no block given, returns an \Enumerator.
* With no block given, returns an Enumerator.
*
*/
static VALUE
Expand Down Expand Up @@ -424,7 +424,7 @@ find_index_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
* ['a', 'b', 'c', 'b'].find_index {|element| element.start_with?('b') } # => 1
* {foo: 0, bar: 1, baz: 2}.find_index {|key, value| value > 1 } # => 2
*
* With no argument and no block given, returns an \Enumerator.
* With no argument and no block given, returns an Enumerator.
*
*/

Expand Down Expand Up @@ -501,7 +501,7 @@ enum_size_over_p(VALUE obj, long n)
* a = {foo: 0, bar: 1, baz: 2}.select {|key, value| key.start_with?('b') }
* a # => {:bar=>1, :baz=>2}
*
* With no block given, returns an \Enumerator.
* With no block given, returns an Enumerator.
*
* Related: #reject.
*/
Expand Down Expand Up @@ -543,7 +543,7 @@ filter_map_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
* (0..9).filter_map {|i| i * 2 if i.even? } # => [0, 4, 8, 12, 16]
* {foo: 0, bar: 1, baz: 2}.filter_map {|key, value| key if value.even? } # => [:foo, :baz]
*
* When no block given, returns an \Enumerator.
* When no block given, returns an Enumerator.
*
*/
static VALUE
Expand Down Expand Up @@ -584,7 +584,7 @@ reject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
* (0..9).reject {|i| i * 2 if i.even? } # => [1, 3, 5, 7, 9]
* {foo: 0, bar: 1, baz: 2}.reject {|key, value| key if value.odd? } # => {:foo=>0, :baz=>2}
*
* When no block given, returns an \Enumerator.
* When no block given, returns an Enumerator.
*
* Related: #select.
*/
Expand Down Expand Up @@ -631,7 +631,7 @@ collect_all(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
* (0..4).map {|i| i*i } # => [0, 1, 4, 9, 16]
* {foo: 0, bar: 1, baz: 2}.map {|key, value| value*2} # => [0, 2, 4]
*
* With no block given, returns an \Enumerator.
* With no block given, returns an Enumerator.
*
*/
static VALUE
Expand Down Expand Up @@ -681,7 +681,7 @@ flat_map_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
* [[0, 1], [2, 3]].flat_map {|e| e + [100] } # => [0, 1, 100, 2, 3, 100]
* {foo: 0, bar: 1, baz: 2}.flat_map {|key, value| [key, value] } # => [:foo, 0, :bar, 1, :baz, 2]
*
* With no block given, returns an \Enumerator.
* With no block given, returns an Enumerator.
*
* Alias: #collect_concat.
*/
Expand Down Expand Up @@ -4905,7 +4905,7 @@ enum_compact(VALUE obj)
* - #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.
* - #tally: Returns a new Hash containing the counts of occurrences of each element.
*
* === Methods for Fetching
*
Expand All @@ -4926,20 +4926,20 @@ enum_compact(VALUE obj)
* 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.
* - #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.
* - #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+,
* - #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+,
* - #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+
* - #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.
Expand Down Expand Up @@ -5040,18 +5040,18 @@ enum_compact(VALUE obj)
*
* 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.
* - <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.
* - 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.
* and so it is not shown. Example: #tally would find exactly one of each Hash entry.
*
*/

Expand Down
2 changes: 1 addition & 1 deletion object.c
Expand Up @@ -4244,7 +4244,7 @@ f_sprintf(int c, const VALUE *v, VALUE _)
* and frozen state.
* - #define_singleton_method: Defines a singleton method in +self+
* for the given symbol method-name and block or proc.
* - #display: Prints +self+ to the given \IO stream or <tt>$stdout</tt>.
* - #display: Prints +self+ to the given IO stream or <tt>$stdout</tt>.
* - #dup: Returns a shallow unfrozen copy of +self+.
* - #enum_for (aliased as #to_enum): Returns an Enumerator for +self+
* using the using the given method, arguments, and block.
Expand Down
2 changes: 1 addition & 1 deletion string.rb
Expand Up @@ -265,7 +265,7 @@
#
# <b><tt>string[regexp, capture = 0]</tt></b>
#
# When the \Regexp argument +regexp+ is given,
# When the Regexp argument +regexp+ is given,
# and the +capture+ argument is <tt>0</tt>,
# the slice is the first matching substring found in +self+:
#
Expand Down
2 changes: 1 addition & 1 deletion struct.c
Expand Up @@ -561,7 +561,7 @@ rb_struct_define_under(VALUE outer, const char *name, ...)
*
* <b>Member Names</b>
*
* \Symbol arguments +member_names+
* Symbol arguments +member_names+
* determines the members of the new subclass:
*
* Struct.new(:foo, :bar).members # => [:foo, :bar]
Expand Down
2 changes: 1 addition & 1 deletion time.c
Expand Up @@ -3637,7 +3637,7 @@ tmcmp(struct tm *a, struct tm *b)
* Time.utc(Float(0.0), Rational(1, 1), 1.0, 0.0, 0.0, 0.0, 0.0)
* # => 0000-01-01 00:00:00 UTC
*
* - \String integers:
* - String integers:
*
* a = %w[0 1 1 0 0 0 0 0]
* # => ["0", "1", "1", "0", "0", "0", "0", "0"]
Expand Down
2 changes: 1 addition & 1 deletion timev.rb
Expand Up @@ -359,7 +359,7 @@ def self.at(time, subsec = false, unit = :microsecond, in: nil)
# Time.new(Float(0.0), Rational(1, 1), 1.0, 0.0, 0.0, 0.0)
# # => 0000-01-01 00:00:00 -0600
#
# - \String integers:
# - String integers:
#
# a = %w[0 1 1 0 0 0]
# # => ["0", "1", "1", "0", "0", "0"]
Expand Down
4 changes: 2 additions & 2 deletions weakmap.c
Expand Up @@ -894,8 +894,8 @@ wkmap_clear(VALUE self)
* call-seq:
* map.inspect -> new_string
*
* Returns a new \String containing informations about the map:
* Returns a new String containing informations about the map:
*
* m = ObjectSpace::WeakKeyMap.new
* m[key] = value
* m.inspect # => "#<ObjectSpace::WeakKeyMap:0x00000001028dcba8 size=1>"
Expand Down

0 comments on commit 8c5b9eb

Please sign in to comment.