Skip to content

Commit 057ee25

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
[DOC] Tweaks for Hash#to_proc
1 parent ae7890d commit 057ee25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4817,12 +4817,15 @@ hash_proc_call(RB_BLOCK_CALL_FUNC_ARGLIST(key, hash))
48174817
* to_proc -> proc
48184818
*
48194819
* Returns a Proc object that maps a key to its value:
4820+
*
48204821
* h = {foo: 0, bar: 1, baz: 2}
48214822
* proc = h.to_proc
48224823
* proc.class # => Proc
48234824
* proc.call(:foo) # => 0
48244825
* proc.call(:bar) # => 1
48254826
* proc.call(:nosuch) # => nil
4827+
*
4828+
* Related: see {Methods for Converting}[rdoc-ref:Hash@Methods+for+Converting].
48264829
*/
48274830
static VALUE
48284831
rb_hash_to_proc(VALUE hash)

0 commit comments

Comments
 (0)