概要
Kernel#block_given?
詳細
メソッドにブロックが与えられていれば真を返します。
サンプルコード
# encoding: utf-8 def hoge puts block_given? end hoge hoge {} hoge do end
出力
false true true
Kernel#block_given?
メソッドにブロックが与えられていれば真を返します。
# encoding: utf-8 def hoge puts block_given? end hoge hoge {} hoge do end
false true true