We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae7890d commit 057ee25Copy full SHA for 057ee25
hash.c
@@ -4817,12 +4817,15 @@ hash_proc_call(RB_BLOCK_CALL_FUNC_ARGLIST(key, hash))
4817
* to_proc -> proc
4818
*
4819
* Returns a Proc object that maps a key to its value:
4820
+ *
4821
* h = {foo: 0, bar: 1, baz: 2}
4822
* proc = h.to_proc
4823
* proc.class # => Proc
4824
* proc.call(:foo) # => 0
4825
* proc.call(:bar) # => 1
4826
* proc.call(:nosuch) # => nil
4827
4828
+ * Related: see {Methods for Converting}[rdoc-ref:Hash@Methods+for+Converting].
4829
*/
4830
static VALUE
4831
rb_hash_to_proc(VALUE hash)
0 commit comments