Pattern Matching with case/in

Not a switch statement β€” a structural matcher

case/in (Ruby 3.0+) is one of the biggest additions to modern Ruby, and it's nothing like case/when. case/when asks "does this value match?"; case/in asks *"does this data have this shape, and if so, bind these pieces to variables."* It destructures arrays and hashes, checks types, and extracts values β€” in one construct. It's tailor-made for parsing the webhook payloads from the last lesson.

In an interview, say: "case/in is structural pattern matching β€” it matches the shape of data and destructures it in one step, binding parts to locals. It's how I'd parse a variable-shaped API payload instead of a pile of nested if/dig checks."