Challenge 3: A Method That Yields — Solution def with_timing if block_given? puts "Starting..." yield puts "Done!" else puts "No block given!" end end with_timing do puts "Doing some work..." end with_timing =begin Output: Starting... Doing some work... Done! No block given! Notes: - block_given? checks whether the current call to with_timing was given a block at all, before attempting to yield to it. - The first call passes a block with do...end, so yield hands control to that block's body (the "Doing some work..." line) in between the two puts statements inside with_timing. - The second call passes no block at all — no error is raised, because block_given? caught that case and printed a fallback message instead of reaching the yield line, which would otherwise raise a LocalJumpError. =end