def fun
    yield if block_given?
end

prox = proc { puts 'proc' }
lamb = lambda { puts 'lambda' }
lamd = -> () { puts 'lambda shorthand' }

fun() { puts 'block' }
fun(&prox)
fun(&lamb)
fun(&lamd)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: