to_proc()
Returns a Proc which maps keys to values.
h = {a:1, b:2} hp = h.to_proc hp.call(:a) #=> 1 hp.call(:b) #=> 2 hp.call(:c) #=> nil [:a, :b, :c].map(&h) #=> [1, 2, nil]
static VALUE rb_hash_to_proc(VALUE hash) { return rb_func_proc_new(hash_proc_call, hash); }