From d3bb42776c4232c51729c77da91c127e79468b27 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Wed, 29 Jan 2025 09:16:47 -0600 Subject: [PATCH] [DOC] Tweaks for rb_hash_s_try_convert --- hash.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hash.c b/hash.c index 4a0ca58c1e..dd11aa811b 100644 --- a/hash.c +++ b/hash.c @@ -1902,16 +1902,15 @@ rb_check_hash_type(VALUE hash) /* * call-seq: - * Hash.try_convert(obj) -> obj, new_hash, or nil + * Hash.try_convert(object) -> object, new_hash, or nil * - * If +obj+ is a +Hash+ object, returns +obj+. + * If +object+ is a hash, returns +object+. * - * Otherwise if +obj+ responds to :to_hash, - * calls obj.to_hash and returns the result. + * Otherwise if +object+ responds to +:to_hash+, + * calls object.to_hash; + * returns the result if it is a hash, or raises TypeError if not. * - * Returns +nil+ if +obj+ does not respond to :to_hash - * - * Raises an exception unless obj.to_hash returns a +Hash+ object. + * Otherwise if +object+ does not respond to +:to_hash+, returns +nil+. */ static VALUE rb_hash_s_try_convert(VALUE dummy, VALUE hash)