Ruby: pass around a block

You have the following:

callable = proc { puts 'Hello' }

Pass it to a function like this:

def pass_me_something
  yield if block_given?
end

pass_me_something(&callable)

Or be explicit:

def pass_me_something(&block)
  block.call if block_given?
end

pass_me_something(&callable)

You can also be weird:

def pass_me_something(block)
  block.call if block&.is_a?(Proc)
end

pass_me_something(callable)