turns out ruby has #block_given? method