summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorBurdetteLamar <[email protected]>2025-03-12 14:37:38 -0500
committerPeter Zhu <[email protected]>2025-03-13 21:11:47 -0400
commit057ee25d1b5f0882615063c41d21083bd7c78415 ()
tree32f3c7c804028a0d1a63a982fe88569efce1257e /hash.c
parentae7890df33577b9f4eecab5626644d619ba442dd (diff)
[DOC] Tweaks for Hash#to_proc
Notes: Merged: https://.com/ruby/ruby/pull/12919
-rw-r--r--hash.c3
1 files changed, 3 insertions, 0 deletions
@@ -4817,12 +4817,15 @@ hash_proc_call(RB_BLOCK_CALL_FUNC_ARGLIST(key, hash))
* to_proc -> proc
*
* Returns a Proc object that maps a key to its value:
* h = {foo: 0, bar: 1, baz: 2}
* proc = h.to_proc
* proc.class # => Proc
* proc.call(:foo) # => 0
* proc.call(:bar) # => 1
* proc.call(:nosuch) # => nil
*/
static VALUE
rb_hash_to_proc(VALUE hash)