14件ヒット
[1-14件を表示]
(0.055秒)
クラス
- Proc (14)
検索結果
-
Proc
. new -> Proc (109.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...ブロックをコンテキストとともにオブジェクト化して返します。
ブロックを指定しない場合、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力......ArgumentError が発生します。
//emlist[例][ruby]{
def foo
Proc.new
end
foo
# => -:2:in `new': tried to create Proc object without a block (ArgumentError)
# from -:2:in `foo'
# from -:4:in `<main>'
//}
Proc.new は、Proc#initialize が定義されていれば
オブジェ... -
Proc
. new { . . . } -> Proc (109.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...ブロックをコンテキストとともにオブジェクト化して返します。
ブロックを指定しない場合、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力......ArgumentError が発生します。
//emlist[例][ruby]{
def foo
Proc.new
end
foo
# => -:2:in `new': tried to create Proc object without a block (ArgumentError)
# from -:2:in `foo'
# from -:4:in `<main>'
//}
Proc.new は、Proc#initialize が定義されていれば
オブジェ...