Instead of devising some half-baked death trap, you can get those little cage traps where the rat/mouse/squirrel/… ends up safe but trapped and you can release it outside. The number of rats in a city is comparable to the number of humans; if you don’t want them indoors then your efforts are best spent plugging up the little holes where they come in. You couldn’t possibly murder them all (the neighbourhood cats generally do a decent job of that).