2件ヒット
  
    
      [1-2件を表示]
    
  
    (0.611秒)
  
  
    トップページ >  :Kernel.#p
:Kernel.#p![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :Array
:Array![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :lambda
:lambda![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :public_instance_method
:public_instance_method![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :cpp_command
:cpp_command![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :exception
:exception![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :exit!
:exit!![条件を削除 [x]](/images/drop-condition-icon.png) > クラス:Proc
 > クラス:Proc![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :2.3.0
:2.3.0![条件を削除 [x]](/images/drop-condition-icon.png) 
  
 :Kernel.#p
:Kernel.#p![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :Array
:Array![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :lambda
:lambda![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :public_instance_method
:public_instance_method![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :cpp_command
:cpp_command![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :exception
:exception![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :exit!
:exit!![条件を削除 [x]](/images/drop-condition-icon.png) > クラス:Proc
 > クラス:Proc![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :2.3.0
:2.3.0![条件を削除 [x]](/images/drop-condition-icon.png) 
  ライブラリ
- ビルトイン (2)
検索結果
- 
      Proc. new -> Proc (9358.0) 
- 
      
      
      ブロックをコンテキストとともにオブジェクト化して返します。 ...OSE = true のときには警告メッセージ
 「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
 が出力され、Ruby 3.0 では
 ArgumentError (tried to create Proc object without a block)
 が発生します。
 ブロックを指定しなければ、こ......上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
 //emlist[例][ruby]{
 def foo
 pr = Proc.new
 pr.call(1)
 end
 foo {|arg| p arg }
 # => 1
 //}
 これは以下と同じです。
 //emlist[例][ruby]{
 def foo
 yield(1)
 end
 foo {|arg| p ar......entError が発生します。
 //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 (9358.0) 
- 
      
      
      ブロックをコンテキストとともにオブジェクト化して返します。 ...OSE = true のときには警告メッセージ
 「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
 が出力され、Ruby 3.0 では
 ArgumentError (tried to create Proc object without a block)
 が発生します。
 ブロックを指定しなければ、こ......上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
 //emlist[例][ruby]{
 def foo
 pr = Proc.new
 pr.call(1)
 end
 foo {|arg| p arg }
 # => 1
 //}
 これは以下と同じです。
 //emlist[例][ruby]{
 def foo
 yield(1)
 end
 foo {|arg| p ar......entError が発生します。
 //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 が定義されていれば
 オブジェクト...
