def do_something()
if block_given?
yield
else
return
end
end

or

def do_something(&blck)
unless blck.nil?
# or ... should I do something with blck rather than yield
yield
else
return
end
end