ITP - more stuff - exercise - passing block

We talked about blocks earlier in this book but we're gonna go a little
deeper and show you some of the power of blocks. Blocks, like
parameters, can be passed into a method just like normal variables. This
isn't incredibly hard, and it's very powerful. Let's look at how we
accomplish this.

def take_block(&block)
  block.call
end

take_block do
  puts "Block being called in the method!"
end

This is a pretty simple example. The ampersand (&) in the method
definition tells us that the argument is a block. You could name it
anything you wanted. The block must always be the last parameter in the
method definition. When we're ready to use the method, we call it like
any other method: take_block. The only difference is that because this
method can accept a block, we can pass in a block of code using do/end.
As you can see, we've been using blocks all along, but this is the first
time we've defined our own method that takes a block as an argument.