るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.201秒)
トップページ > クエリ:t[x] > クエリ:ruby[x] > 種類:モジュール関数[x] > クエリ:E[x] > モジュール:Kernel[x] > クエリ:puts[x] > クエリ:iterator?[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. open3 capture2e
  4. matrix rank_e
  5. matrix det_e

ライブラリ

検索結果

Kernel.#iterator? -> bool (24339.0)

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

...se を返します。

iterator?
は (ブロックが必ずイテレートするとはいえないので)推奨されていないの
で block_given? を使ってください。

//emlist[例][ruby]{
def check
if block_given?
puts
"Block is given."
e
lse
puts
"Block isn't given."
e
n...
...d
e
nd
check{} #=> Block is given.
check #=> Block isn't given.
//}...

Kernel.#block_given? -> bool (6139.0)

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

...se を返します。

iterator?
は (ブロックが必ずイテレートするとはいえないので)推奨されていないの
で block_given? を使ってください。

//emlist[例][ruby]{
def check
if block_given?
puts
"Block is given."
e
lse
puts
"Block isn't given."
e
n...
...d
e
nd
check{} #=> Block is given.
check #=> Block isn't given.
//}...