From 7fd589c7fc26b0494990134d6bef699c92a9336c Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Mon, 10 Feb 2025 13:31:41 -0600 Subject: [PATCH] [DOC] Tweaks for Hash#assoc (#12726) --- hash.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hash.c b/hash.c index 44797d23c9..3ba5b43282 100644 --- a/hash.c +++ b/hash.c @@ -4158,13 +4158,15 @@ assoc_i(VALUE key, VALUE val, VALUE arg) /* * call-seq: - * hash.assoc(key) -> new_array or nil + * assoc(key) -> entry or nil + * + * If the given +key+ is found, returns its entry as a 2-element array + * containing that key and its value: * - * If the given +key+ is found, returns a 2-element Array containing that key and its value: * h = {foo: 0, bar: 1, baz: 2} * h.assoc(:bar) # => [:bar, 1] * - * Returns +nil+ if key +key+ is not found. + * Returns +nil+ if the key is not found. */ static VALUE