[DOC] Update Proc.new without a block [ci skip]

[Feature #10499]
[Feature #15554]
This commit is contained in:
Nobuyoshi Nakada 2021-01-04 15:50:30 +09:00
Родитель cf4a6b5e7b
Коммит 8da7f4abc7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7CD2805BFA3770C6
1 изменённых файлов: 6 добавлений и 9 удалений

15
proc.c
Просмотреть файл

@ -799,18 +799,15 @@ proc_new(VALUE klass, int8_t is_lambda, int8_t kernel)
/* /*
* call-seq: * call-seq:
* Proc.new {|...| block } -> a_proc * Proc.new {|...| block } -> a_proc
* Proc.new -> a_proc
* *
* Creates a new Proc object, bound to the current context. Proc::new * Creates a new Proc object, bound to the current context.
* may be called without a block only within a method with an
* attached block, in which case that block is converted to the Proc
* object.
* *
* def proc_from * proc = Proc.new { "hello" }
* Proc.new
* end
* proc = proc_from { "hello" }
* proc.call #=> "hello" * proc.call #=> "hello"
*
* Raises ArgumentError if called without a block.
*
* Proc.new #=> ArgumentError
*/ */
static VALUE static VALUE