るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.042秒)

別のキーワード

  1. string b
  2. _builtin b
  3. b _builtin
  4. b string
  5. b

ライブラリ

モジュール

検索結果

Kernel.#iterator? -> bool (18214.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 (6114.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.
//}...