以下の内容はhttps://tbpgr.hatenablog.com/entry/20140507/1399469763より取得しました。


Ruby | Kernel | block_given?

概要

Kernel#block_given?

詳細

メソッドにブロックが与えられていれば真を返します。

サンプルコード
# encoding: utf-8

def hoge
  puts block_given?
end

hoge
hoge {}
hoge do

end
出力
false
true
true



以上の内容はhttps://tbpgr.hatenablog.com/entry/20140507/1399469763より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14