xxxxxxxxxx
# block as a named param
def my_method(&my_block)
puts "before call"
my_block.call
puts "after call"
end
# un-named block that can be optionally supplied
def my_other_method
puts "before call"
yield if block_given?
puts "after call"
end
my_method do
puts 'inside my_method'
end
my_other_method do
puts 'inside my_other_method'
end