aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-04-14 11:17:37 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-04-14 11:17:37 +0900
commit5d45afdbbf058d82ced0b12bf9e4b2978db9f4e0 (patch)
treec5d960afaa2ef7699a009787102a82d4da665118 /proc.c
parent3728f83b2d8e9d4705f835a572e6886a74562e8a (diff)
downloadruby-5d45afdbbf058d82ced0b12bf9e4b2978db9f4e0.tar.gz
[DOC] Move the documentations of moved Symbol methods
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index f2b3c1ff21..d5d0bbdb46 100644
--- a/proc.c
+++ b/proc.c
@@ -1471,6 +1471,21 @@ rb_hash_proc(st_index_t hash, VALUE prc)
return rb_hash_uint(hash, (st_index_t)proc->block.as.captured.ep);
}
+
+/*
+ * call-seq:
+ * to_proc
+ *
+ * Returns a Proc object which calls the method with name of +self+
+ * on the first parameter and passes the remaining parameters to the method.
+ *
+ * proc = :to_s.to_proc # => #<Proc:0x000001afe0e48680(&:to_s) (lambda)>
+ * proc.call(1000) # => "1000"
+ * proc.call(1000, 16) # => "3e8"
+ * (1..3).collect(&:to_s) # => ["1", "2", "3"]
+ *
+ */
+
MJIT_FUNC_EXPORTED VALUE
rb_sym_to_proc(VALUE sym)
{