It's pretty simple. There's a magnet and a sensor. If the magnet is away from a sensor, it trips the circuit, turning on the LED. There's three button batteries up in there to light the LED with 3.5 volts or so. All that for a buck from the discount store.
So, let's think.
You can get the 3.5 volt current from the power pin of an Arduino, and sending the signal back to the Arduino rather than to an LED, you now get an "Is it closed?" sensor.
So what? What can we do with that?
I don't really care about what happens with the drawers in my office and I really don't care what happens with the drawers in my bedroom. Same, pretty much, with the doors. I never close my closet door, and really, hooking something to the bathroom door has nothing but creepy uses.
So, what can I do with this? I'm failing at ideas.