るりまサーチ (Ruby 3.3)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.050秒)
トップページ > クエリ:Kernel.#p[x] > クエリ:timeout[x] > クエリ:cpp_command[x] > クエリ:lambda[x] > クラス:Proc[x] > バージョン:3.3[x]

別のキーワード

  1. timeout timeout
  2. openssl timeout
  3. openssl timeout=
  4. kernel timeout
  5. timeout timeouterror

ライブラリ

検索結果

Proc.new { ... } -> Proc (9340.0)

ブロックをコンテキストとともにオブジェクト化して返します。

...行ったときに発生します。

//emlist[][ruby]{
pr = Proc.new {|arg| p arg }
pr.call(1) # => 1
//}

//emlist[][ruby]{
Proc
.new # => -e:1:in `new': tried to create Proc object without a block (ArgumentError)
//}

Proc
.new は、Proc#initialize が定義されていれば
オブジェクトの...
...初期化のためにこれを呼び出します。このことを
除けば、Kernel.#proc と同じです。...