22件ヒット
[1-22件を表示]
(0.058秒)
モジュール
- Kernel (22)
検索結果
-
Kernel
. # iterator? -> bool (18309.0) -
メソッドにブロックが与えられていれば真を返します。
...単に false を返します。
iterator? は (ブロックが必ずイテレートするとはいえないので)推奨されていないの
で block_given? を使ってください。
//emlist[例][ruby]{
def check
if block_given?
puts "Block is given."
else
puts "Block isn't gi......ven."
end
end
check{} #=> Block is given.
check #=> Block isn't given.
//}... -
Kernel
. # block _ given? -> bool (6209.0) -
メソッドにブロックが与えられていれば真を返します。
...単に false を返します。
iterator? は (ブロックが必ずイテレートするとはいえないので)推奨されていないの
で block_given? を使ってください。
//emlist[例][ruby]{
def check
if block_given?
puts "Block is given."
else
puts "Block isn't gi......ven."
end
end
check{} #=> Block is given.
check #=> Block isn't given.
//}...