Ruby - Blocks, Procs, and Lambdas
You want to write a Ruby method
process_items that takes an array and optionally a block. If a block is given, it should yield each item to the block; otherwise, it should return the array unchanged. Which code correctly implements this behavior?