るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.085秒)
トップページ > クエリ:_builtin[x] > クエリ:>[x] > クエリ:iterator?[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

モジュール

検索結果

Kernel.#iterator? -> bool (23207.0)

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

...

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

//emlist[例][ruby]{
def check
if block_given?
puts "Block is given."
else
puts "Block isn't given."
end
end
check{} #=> Blo...
...ck is given.
check #=> Block isn't given.
//}...

Kernel.#block_given? -> bool (8107.0)

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

...

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

//emlist[例][ruby]{
def check
if block_given?
puts "Block is given."
else
puts "Block isn't given."
end
end
check{} #=> Blo...
...ck is given.
check #=> Block isn't given.
//}...