Code block confusion

I am sifting through the Ruby bible “Pickaxe” and I am not sure how you
figure out which methods can be passed a code block.

I have seen them used in arrays [1,2,3,4].each{|x|puts x} ; which sort
of makes sense, but there is another piece in the book that uses the do
end code block on the scan method? p65 at the top. I looked at the ruby
docs for this method and I don’t see how you “know” that the code block
can be used at this point.

Thanks for the help

p.s sorry if I just overlooked it…

p.s sorry if I just overlooked it…

sorry I did overlook it.