Ruby 3.3 リファレンスマニュアル

function rb_block_given_p

[edit]
int rb_block_given_p(void)

メソッドがブロック付きで呼ばれていれば true を返します。