From 8774530ce10bbee5b483b4e7283cc263b246125d Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Thu, 6 Mar 2025 17:08:24 -0600 Subject: [DOC] Tweaks for Hash#rassoc --- hash.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hash.c b/hash.c index e6418449fa..32180b3c7e 100644 --- a/hash.c +++ b/hash.c @@ -4266,13 +4266,16 @@ rassoc_i(VALUE key, VALUE val, VALUE arg) * call-seq: * rassoc(value) -> new_array or nil * - * Returns a new 2-element Array consisting of the key and value - * of the first-found entry whose value is == to value - * (see {Entry Order}[rdoc-ref:Hash@Entry+Order]): + * Searches +self+ for the first entry whose value is == to the given +value+; + * see {Entry Order}[rdoc-ref:Hash@Entry+Order]. + * + * If the entry is found, returns its key and value as a 2-element array; + * returns +nil+ if not found: + * * h = {foo: 0, bar: 1, baz: 1} * h.rassoc(1) # => [:bar, 1] * - * Returns +nil+ if no such value found. + * Related: see {Methods for Fetching}[rdoc-ref:Hash@Methods+for+Fetching]. */ static VALUE -- cgit v1.2.3