diff options
author | BurdetteLamar <[email protected]> | 2024-10-08 15:23:41 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2024-10-08 16:54:42 -0400 |
commit | 015d9ebaec8c564e79e2e808d002eb68341a4020 (patch) | |
tree | a627cd407d35ed43992de521e6d3f43a656db7f6 /array.c | |
parent | 9e121ef985ef6892ac492876fa7345aa92df2f54 (diff) |
[DOC] Tweaks for Array#rassoc
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11836
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -5119,17 +5119,19 @@ rb_ary_assoc(VALUE ary, VALUE key) /* * call-seq: - * array.rassoc(obj) -> found_array or nil + * rassoc(object) -> found_array or nil * - * Returns the first element in +self+ that is an +Array+ - * whose second element <tt>==</tt> +obj+: + * Returns the first element +ele+ in +self+ such that +ele+ is an array + * and <tt>ele[1] == object</tt>: * * a = [{foo: 0}, [2, 4], [4, 5, 6], [4, 5]] * a.rassoc(4) # => [2, 4] + * a.rassoc(5) # => [4, 5, 6] * * Returns +nil+ if no such element is found. * - * Related: #assoc. + * Related: Array#assoc; + * see also {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching]. */ VALUE |