From 015d9ebaec8c564e79e2e808d002eb68341a4020 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Tue, 8 Oct 2024 15:23:41 -0500 Subject: [PATCH] [DOC] Tweaks for Array#rassoc --- array.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/array.c b/array.c index 2a03c1b045..451b19be6e 100644 --- a/array.c +++ b/array.c @@ -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 == +obj+: + * Returns the first element +ele+ in +self+ such that +ele+ is an array + * and ele[1] == object: * * 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